auto startup completed
This commit is contained in:
parent
4dd6d47cf7
commit
4900181241
3 changed files with 17 additions and 12 deletions
|
@ -191,8 +191,8 @@ SchedulerThread :: run(void) throw ()
|
||||||
//DEBUG_FUNC_INFO
|
//DEBUG_FUNC_INFO
|
||||||
|
|
||||||
shouldRun = true;
|
shouldRun = true;
|
||||||
// getCurrentEvent();
|
getCurrentEvent();//implements scheduler autostart
|
||||||
getNextEvent(TimeConversion::now());
|
// getNextEvent(TimeConversion::now());//use if you do not want autostart
|
||||||
|
|
||||||
while (shouldRun) {
|
while (shouldRun) {
|
||||||
Ptr<ptime>::Ref start = TimeConversion::now();
|
Ptr<ptime>::Ref start = TimeConversion::now();
|
||||||
|
|
|
@ -197,19 +197,18 @@ public:
|
||||||
AudioDescription *getNext(){
|
AudioDescription *getNext(){
|
||||||
emptysmilrecovery:
|
emptysmilrecovery:
|
||||||
AudioDescription *audioDescription = NULL;
|
AudioDescription *audioDescription = NULL;
|
||||||
|
|
||||||
|
|
||||||
//TODO: m_smilOffset must contain correct clipOffset once this function exits!!!!!!
|
|
||||||
|
|
||||||
if(m_subSmil != NULL){
|
if(m_subSmil != NULL){
|
||||||
audioDescription = m_subSmil->getNextInternal();
|
audioDescription = m_subSmil->getNextInternal();
|
||||||
if(audioDescription == NULL){
|
if(audioDescription == NULL){
|
||||||
delete m_subSmil;
|
delete m_subSmil;
|
||||||
m_subSmil = NULL;
|
m_subSmil = NULL;
|
||||||
}else{
|
}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;
|
goto emptysmilrecovery;
|
||||||
}
|
}
|
||||||
return audioDescription;
|
return audioDescription;
|
||||||
|
@ -248,11 +247,17 @@ emptysmilrecovery:
|
||||||
goto emptysmilrecovery;
|
goto emptysmilrecovery;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(audioDescription != NULL && m_smilOffset >= audioDescription->m_clipLength)
|
if(audioDescription != NULL)
|
||||||
{
|
{
|
||||||
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 -= actualLength;
|
||||||
goto emptysmilrecovery;
|
goto emptysmilrecovery;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return audioDescription;
|
return audioDescription;
|
||||||
}
|
}
|
||||||
|
|
|
@ -158,7 +158,7 @@ PlaylistEvent :: start(Ptr<time_duration>::Ref offset) thr
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
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();
|
audioPlayer->start();
|
||||||
|
|
||||||
playLog->addPlayLogEntry(playlist->getId(), TimeConversion::now());
|
playLog->addPlayLogEntry(playlist->getId(), TimeConversion::now());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue