2009-02-12, 01:10
I have a SBLive that I am using pass through with This card reports that it supports pause/resume, which it does as long as it is not through SPDIF.
This is a documented bug with this card that even affects windows.
After pause and then resume, the video resumes as expected, but the audio is messed up. Two things will occur.
1. There is still audio, but it is about 1/2 a second of each audio frame, so it stutters, but is not looping.
2. There is no audio
In both cases, the DTS/Dolby light on my amp flickers on/off with the signal. I have had this issue with XBMC for months now, the only solution to it when this occurs is to seek backwards.
I propose the following change to the DVDPlayer, but I am un-sure of the consequences of doing so as I do not understand much about demuxers.
I am compiling right now to test this, but if anyone can comment on this please do so, I am unsure if calling "GetTime()" inside the message loop is thread safe, or if I should be passing "start" to "SyncronizePlayers" instead of "DVD_NOPTS_VALUE".
I have tried just calling "SyncronizePlayers" but it has had no effect.
This is a documented bug with this card that even affects windows.
After pause and then resume, the video resumes as expected, but the audio is messed up. Two things will occur.
1. There is still audio, but it is about 1/2 a second of each audio frame, so it stutters, but is not looping.
2. There is no audio
In both cases, the DTS/Dolby light on my amp flickers on/off with the signal. I have had this issue with XBMC for months now, the only solution to it when this occurs is to seek backwards.
I propose the following change to the DVDPlayer, but I am un-sure of the consequences of doing so as I do not understand much about demuxers.
Code:
Index: xbmc/cores/dvdplayer/DVDPlayer.cpp
===================================================================
--- xbmc/cores/dvdplayer/DVDPlayer.cpp (revision 17664)
+++ xbmc/cores/dvdplayer/DVDPlayer.cpp (working copy)
@@ -1522,6 +1522,7 @@
CDVDMsg* pMsg;
MsgQueueReturnCode ret = m_messenger.Get(&pMsg, 0);
+ double start;
while (ret == MSGQ_OK)
{
@@ -1562,7 +1563,7 @@
CPlayerSeek m_pause(this);
CDVDMsgPlayerSeekChapter &msg(*((CDVDMsgPlayerSeekChapter*)pMsg));
- double start = DVD_NOPTS_VALUE;
+ start = DVD_NOPTS_VALUE;
// This should always be the case.
if(m_pDemuxer && m_pDemuxer->SeekChapter(msg.GetChapter(), &start))
@@ -1694,6 +1695,20 @@
// untill our buffers are somewhat filled
if(m_pDemuxer)
m_pDemuxer->SetSpeed(speed);
+
+ /* Fix audio sync issue when returning to normal speed (I have a buggy SBLive that needs this) */
+ if (speed == DVD_PLAYSPEED_NORMAL)
+ {
+ start = DVD_NOPTS_VALUE;
+ if (m_pDemuxer && m_pDemuxer->SeekTime(GetTime(), false, &start))
+ {
+ if(m_pSubtitleDemuxer)
+ m_pSubtitleDemuxer->SeekTime(GetTime(), false);
+ }
+ FlushBuffers(true);
+ SyncronizePlayers(SYNCSOURCE_ALL, DVD_NOPTS_VALUE);
+ }
+
}
else if (pMsg->IsType(CDVDMsg::PLAYER_CHANNEL_NEXT) || pMsg->IsType(CDVDMsg::PLAYER_CHANNEL_PREV))
{
I am compiling right now to test this, but if anyone can comment on this please do so, I am unsure if calling "GetTime()" inside the message loop is thread safe, or if I should be passing "start" to "SyncronizePlayers" instead of "DVD_NOPTS_VALUE".
I have tried just calling "SyncronizePlayers" but it has had no effect.