From 0d84838ea4e8ee34fcf3d0dbd1324a321386ba26 Mon Sep 17 00:00:00 2001 From: nebojsa Date: Mon, 17 Nov 2008 01:34:27 +0000 Subject: [PATCH] fixed scheduler problem of not being able to play smils --- .../playlistExecutor/src/GstreamerPlayer.cxx | 1 + .../src/products/scheduler/src/XmlRpcDaemon.cxx | 15 ++++++++++++++- .../src/products/scheduler/src/XmlRpcDaemon.h | 3 +++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/campcaster/src/modules/playlistExecutor/src/GstreamerPlayer.cxx b/campcaster/src/modules/playlistExecutor/src/GstreamerPlayer.cxx index 73ea59a2a..09174593f 100644 --- a/campcaster/src/modules/playlistExecutor/src/GstreamerPlayer.cxx +++ b/campcaster/src/modules/playlistExecutor/src/GstreamerPlayer.cxx @@ -301,6 +301,7 @@ GstreamerPlayer :: playNextSmil(void) throw ( } m_smilOffset += m_currentPlayLength; m_playContext->playContext(); + return true; } diff --git a/campcaster/src/products/scheduler/src/XmlRpcDaemon.cxx b/campcaster/src/products/scheduler/src/XmlRpcDaemon.cxx index 80ff02e97..61a384478 100644 --- a/campcaster/src/products/scheduler/src/XmlRpcDaemon.cxx +++ b/campcaster/src/products/scheduler/src/XmlRpcDaemon.cxx @@ -72,10 +72,13 @@ #include "SignalDispatcher.h" #include "XmlRpcDaemonShutdownSignalHandler.h" #include "XmlRpcDaemon.h" +#include using namespace LiveSupport::Scheduler; +GMainLoop *loop; + /* =================================================== local data structures */ @@ -303,7 +306,16 @@ XmlRpcDaemon :: startup (void) throw (std::logic_error) // bind & run xmlRpcServer->enableIntrospection(true); xmlRpcServer->bindAndListen(xmlRpcPort); - xmlRpcServer->work(-1.0); + active = true; + loop = g_main_loop_new (NULL, FALSE); + GMainContext* maincontext = g_main_context_default(); + while(active) + { + g_main_context_iteration(maincontext, FALSE); + xmlRpcServer->work(0.); + } + +// xmlRpcServer->work(-1.0); } @@ -350,6 +362,7 @@ XmlRpcDaemon :: stop (void) throw (std::logic_error) void XmlRpcDaemon :: shutdown (void) throw (std::logic_error) { + active = false; checkForConfiguration(); xmlRpcServer->shutdown(); diff --git a/campcaster/src/products/scheduler/src/XmlRpcDaemon.h b/campcaster/src/products/scheduler/src/XmlRpcDaemon.h index abf1637ac..48fe20f4b 100644 --- a/campcaster/src/products/scheduler/src/XmlRpcDaemon.h +++ b/campcaster/src/products/scheduler/src/XmlRpcDaemon.h @@ -188,6 +188,8 @@ class XmlRpcDaemon */ pid_t loadPid(void) throw(); + + bool active; protected: /** @@ -197,6 +199,7 @@ class XmlRpcDaemon { background = true; configured = false; + active = false; xmlRpcServer.reset(new XmlRpcServer()); }