Permalink
Browse files

[dvdplayer] push back sync objects in message queue to process prio m…

…essage

Note, this could be moved into message queue and hidden from players
but i'm not sure it's that beneficial.
  • Loading branch information...
1 parent 9303d3c commit a88ec7aa5244f36329dce43be7b501e82f29851f @elupus elupus committed Jun 14, 2012
Showing with 15 additions and 7 deletions.
  1. +4 −2 xbmc/cores/dvdplayer/DVDPlayerAudio.cpp
  2. +11 −5 xbmc/cores/dvdplayer/DVDPlayerVideo.cpp
View
6 xbmc/cores/dvdplayer/DVDPlayerAudio.cpp
@@ -419,8 +419,10 @@ int CDVDPlayerAudio::DecodeFrame(DVDAudioFrame &audioframe, bool bDropPacket)
}
else if (pMsg->IsType(CDVDMsg::GENERAL_SYNCHRONIZE))
{
- ((CDVDMsgGeneralSynchronize*)pMsg)->Wait( &m_bStop, SYNCSOURCE_AUDIO );
- CLog::Log(LOGDEBUG, "CDVDPlayerAudio - CDVDMsg::GENERAL_SYNCHRONIZE");
+ if(((CDVDMsgGeneralSynchronize*)pMsg)->Wait( 100, SYNCSOURCE_AUDIO ))
+ CLog::Log(LOGDEBUG, "CDVDPlayerAudio - CDVDMsg::GENERAL_SYNCHRONIZE");
+ else
+ m_messageQueue.Put(pMsg->Acquire(), 1); /* push back as prio message, to process other prio messages */
}
else if (pMsg->IsType(CDVDMsg::GENERAL_RESYNC))
{ //player asked us to set internal clock
View
16 xbmc/cores/dvdplayer/DVDPlayerVideo.cpp
@@ -362,13 +362,19 @@ void CDVDPlayerVideo::Process()
if (pMsg->IsType(CDVDMsg::GENERAL_SYNCHRONIZE))
{
- ((CDVDMsgGeneralSynchronize*)pMsg)->Wait( &m_bStop, SYNCSOURCE_VIDEO );
- CLog::Log(LOGDEBUG, "CDVDPlayerVideo - CDVDMsg::GENERAL_SYNCHRONIZE");
+ if(((CDVDMsgGeneralSynchronize*)pMsg)->Wait(100, SYNCSOURCE_VIDEO))
+ {
+ CLog::Log(LOGDEBUG, "CDVDPlayerVideo - CDVDMsg::GENERAL_SYNCHRONIZE");
+
+ /* we may be very much off correct pts here, but next picture may be a still*/
+ /* make sure it isn't dropped */
+ m_iNrOfPicturesNotToSkip = 5;
+ }
+ else
+ m_messageQueue.Put(pMsg->Acquire(), 1); /* push back as prio message, to process other prio messages */
+
pMsg->Release();
- /* we may be very much off correct pts here, but next picture may be a still*/
- /* make sure it isn't dropped */
- m_iNrOfPicturesNotToSkip = 5;
continue;
}
else if (pMsg->IsType(CDVDMsg::GENERAL_RESYNC))

0 comments on commit a88ec7a

Please sign in to comment.