Skip to content

Commit

Permalink
[dvdplayer] push back sync objects in message queue to process prio m…
Browse files Browse the repository at this point in the history
…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
elupus committed Jun 17, 2012
1 parent 9303d3c commit a88ec7a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
6 changes: 4 additions & 2 deletions xbmc/cores/dvdplayer/DVDPlayerAudio.cpp
Expand Up @@ -419,8 +419,10 @@ int CDVDPlayerAudio::DecodeFrame(DVDAudioFrame &audioframe, bool bDropPacket)
} }
else if (pMsg->IsType(CDVDMsg::GENERAL_SYNCHRONIZE)) else if (pMsg->IsType(CDVDMsg::GENERAL_SYNCHRONIZE))
{ {
((CDVDMsgGeneralSynchronize*)pMsg)->Wait( &m_bStop, SYNCSOURCE_AUDIO ); if(((CDVDMsgGeneralSynchronize*)pMsg)->Wait( 100, SYNCSOURCE_AUDIO ))
CLog::Log(LOGDEBUG, "CDVDPlayerAudio - CDVDMsg::GENERAL_SYNCHRONIZE"); 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)) else if (pMsg->IsType(CDVDMsg::GENERAL_RESYNC))
{ //player asked us to set internal clock { //player asked us to set internal clock
Expand Down
16 changes: 11 additions & 5 deletions xbmc/cores/dvdplayer/DVDPlayerVideo.cpp
Expand Up @@ -362,13 +362,19 @@ void CDVDPlayerVideo::Process()


if (pMsg->IsType(CDVDMsg::GENERAL_SYNCHRONIZE)) if (pMsg->IsType(CDVDMsg::GENERAL_SYNCHRONIZE))
{ {
((CDVDMsgGeneralSynchronize*)pMsg)->Wait( &m_bStop, SYNCSOURCE_VIDEO ); if(((CDVDMsgGeneralSynchronize*)pMsg)->Wait(100, SYNCSOURCE_VIDEO))
CLog::Log(LOGDEBUG, "CDVDPlayerVideo - CDVDMsg::GENERAL_SYNCHRONIZE"); {
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(); 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; continue;
} }
else if (pMsg->IsType(CDVDMsg::GENERAL_RESYNC)) else if (pMsg->IsType(CDVDMsg::GENERAL_RESYNC))
Expand Down

0 comments on commit a88ec7a

Please sign in to comment.