From 490018124103a7040fb752ca4e313edbc78f3828 Mon Sep 17 00:00:00 2001 From: nebojsa Date: Fri, 6 Nov 2009 02:13:11 +0000 Subject: [PATCH] auto startup completed --- .../eventScheduler/src/SchedulerThread.cxx | 4 ++-- .../playlistExecutor/src/SmilHandler.h | 23 +++++++++++-------- .../products/scheduler/src/PlaylistEvent.cxx | 2 +- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/campcaster/src/modules/eventScheduler/src/SchedulerThread.cxx b/campcaster/src/modules/eventScheduler/src/SchedulerThread.cxx index 9b014a840..49e824f32 100644 --- a/campcaster/src/modules/eventScheduler/src/SchedulerThread.cxx +++ b/campcaster/src/modules/eventScheduler/src/SchedulerThread.cxx @@ -191,8 +191,8 @@ SchedulerThread :: run(void) throw () //DEBUG_FUNC_INFO shouldRun = true; -// getCurrentEvent(); - getNextEvent(TimeConversion::now()); + getCurrentEvent();//implements scheduler autostart +// getNextEvent(TimeConversion::now());//use if you do not want autostart while (shouldRun) { Ptr::Ref start = TimeConversion::now(); diff --git a/campcaster/src/modules/playlistExecutor/src/SmilHandler.h b/campcaster/src/modules/playlistExecutor/src/SmilHandler.h index f79146e54..2911fc45e 100644 --- a/campcaster/src/modules/playlistExecutor/src/SmilHandler.h +++ b/campcaster/src/modules/playlistExecutor/src/SmilHandler.h @@ -197,19 +197,18 @@ public: AudioDescription *getNext(){ emptysmilrecovery: AudioDescription *audioDescription = NULL; - - -//TODO: m_smilOffset must contain correct clipOffset once this function exits!!!!!! - if(m_subSmil != NULL){ audioDescription = m_subSmil->getNextInternal(); if(audioDescription == NULL){ delete m_subSmil; m_subSmil = NULL; }else{ - if(m_smilOffset >= audioDescription->m_clipLength) + gint64 actualLength = audioDescription->m_clipEnd != -1 ? + audioDescription->m_clipEnd - audioDescription->m_clipBegin : + audioDescription->m_clipLength - audioDescription->m_clipBegin; + if(m_smilOffset >= actualLength) { - m_smilOffset -= audioDescription->m_clipLength; + m_smilOffset -= actualLength; goto emptysmilrecovery; } return audioDescription; @@ -248,10 +247,16 @@ emptysmilrecovery: goto emptysmilrecovery; } } - if(audioDescription != NULL && m_smilOffset >= audioDescription->m_clipLength) + if(audioDescription != NULL) { - m_smilOffset -= audioDescription->m_clipLength; - goto emptysmilrecovery; + gint64 actualLength = audioDescription->m_clipEnd != -1 ? + audioDescription->m_clipEnd - audioDescription->m_clipBegin : + audioDescription->m_clipLength - audioDescription->m_clipBegin; + if(m_smilOffset >= actualLength) + { + m_smilOffset -= actualLength; + goto emptysmilrecovery; + } } return audioDescription; diff --git a/campcaster/src/products/scheduler/src/PlaylistEvent.cxx b/campcaster/src/products/scheduler/src/PlaylistEvent.cxx index 2ba75de2c..e8a732690 100644 --- a/campcaster/src/products/scheduler/src/PlaylistEvent.cxx +++ b/campcaster/src/products/scheduler/src/PlaylistEvent.cxx @@ -158,7 +158,7 @@ PlaylistEvent :: start(Ptr::Ref offset) thr } try { - audioPlayer->open(*playlist->getUri(), (gint64)playlist->getId()->getId(), offset->total_microseconds()); + audioPlayer->open(*playlist->getUri(), (gint64)playlist->getId()->getId(), offset->total_nanoseconds()); audioPlayer->start(); playLog->addPlayLogEntry(playlist->getId(), TimeConversion::now());