auto startup completed

This commit is contained in:
nebojsa 2009-11-06 02:13:11 +00:00
parent 4dd6d47cf7
commit 4900181241
3 changed files with 17 additions and 12 deletions

View File

@ -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<ptime>::Ref start = TimeConversion::now();

View File

@ -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;

View File

@ -158,7 +158,7 @@ PlaylistEvent :: start(Ptr<time_duration>::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());