summaryrefslogtreecommitdiff
path: root/thread.cpp
diff options
context:
space:
mode:
authorDieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de>2008-06-21 01:22:21 +0200
committerDieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de>2008-06-21 01:22:21 +0200
commit54ac5eaaab8065473fb023c713e383b7fe5d15a9 (patch)
tree1ab4ffaf5eb3817efb68e419598671f29bc7e940 /thread.cpp
parent189d1d07d4971a4d0cc8d0d700c62f541258c33a (diff)
downloadvdr-plugin-live-54ac5eaaab8065473fb023c713e383b7fe5d15a9.tar.gz
vdr-plugin-live-54ac5eaaab8065473fb023c713e383b7fe5d15a9.tar.bz2
Changed the definition of tntversion in the LIVE source files.
Now there is a define TNTVERSION set to a number that can be compared in C oreprocessor 'if' statements. This allows for adding support for tntnet specific features with evolving tntnet version.
Diffstat (limited to 'thread.cpp')
-rw-r--r--thread.cpp25
1 files changed, 13 insertions, 12 deletions
diff --git a/thread.cpp b/thread.cpp
index 24c0e12..8bd0584 100644
--- a/thread.cpp
+++ b/thread.cpp
@@ -11,7 +11,7 @@ namespace vdrlive {
using namespace std;
using namespace tnt;
-#ifndef TNTVERS7
+#if TNTVERSION < 1606
class ProtectedCString
{
public:
@@ -23,7 +23,7 @@ public:
private:
char* m_string;
};
-#endif // TNTVERS7
+#endif // TNTVERSION < 1606
ServerThread::ServerThread()
{
@@ -45,24 +45,25 @@ void ServerThread::Stop()
void ServerThread::Action()
{
try {
-#ifdef TNTVERS7
- tnt::Tntconfig tntconfig;
- tntconfig.load(TntConfig::Get().GetConfigPath().c_str());
+#if TNTVERSION >= 1606
+ // tnt::Tntconfig tntconfig;
+ // tntconfig.load(TntConfig::Get().GetConfigPath().c_str());
m_server.reset(new Tntnet());
- m_server->init(tntconfig);
+ //m_server->init(tntconfig);
+ TntConfig::Get().Configure(*m_server);
#else
- ProtectedCString configPath( TntConfig::Get().GetConfigPath().c_str() );
+ 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.reset(new Tntnet( argc, argv ));
+#endif // TNTVERSION
m_server->run();
- m_server.reset( 0 );
- } catch ( exception const& ex ) {
+ m_server.reset(0);
+ } catch (exception const& ex) {
// XXX move initial error handling to live.cpp
- esyslog( "ERROR: live httpd server crashed: %s", ex.what() );
+ esyslog("ERROR: live httpd server crashed: %s", ex.what());
cerr << "HTTPD FATAL ERROR: " << ex.what() << endl;
//cThread::EmergencyExit(true);
}