summaryrefslogtreecommitdiff
path: root/thread.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'thread.cpp')
-rw-r--r--thread.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/thread.cpp b/thread.cpp
index b6d6bf3..24c0e12 100644
--- a/thread.cpp
+++ b/thread.cpp
@@ -11,6 +11,7 @@ namespace vdrlive {
using namespace std;
using namespace tnt;
+#ifndef TNTVERS7
class ProtectedCString
{
public:
@@ -22,6 +23,7 @@ public:
private:
char* m_string;
};
+#endif // TNTVERS7
ServerThread::ServerThread()
{
@@ -43,11 +45,19 @@ void ServerThread::Stop()
void ServerThread::Action()
{
try {
+#ifdef TNTVERS7
+ tnt::Tntconfig tntconfig;
+ tntconfig.load(TntConfig::Get().GetConfigPath().c_str());
+ m_server.reset(new Tntnet());
+ m_server->init(tntconfig);
+#else
ProtectedCString configPath( TntConfig::Get().GetConfigPath().c_str() );
char* argv[] = { const_cast< char* >( "tntnet" ), const_cast< char* >( "-c" ), configPath };
int argc = sizeof( argv ) / sizeof( argv[0] );
+
m_server.reset( new Tntnet( argc, argv ) );
+#endif // TNTVERS7
m_server->run();
m_server.reset( 0 );
} catch ( exception const& ex ) {