Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[dvdplayer] restore proper starttime behaviour

It should represent first dts of stream and is used to add start delays
to individual streams that start later than their sibling streams.

This got broken by cd36abf then further code started depending on the broken behaviour.
  • Loading branch information...
commit 8996c0514dc06c8c15f3d27603cdc736f4eb4269 1 parent a88ec7a
@elupus authored
Showing with 20 additions and 16 deletions.
  1. +20 −16 xbmc/cores/dvdplayer/DVDPlayer.cpp
View
36 xbmc/cores/dvdplayer/DVDPlayer.cpp
@@ -1492,9 +1492,17 @@ bool CDVDPlayer::CheckStartCaching(CCurrentStream& current)
bool CDVDPlayer::CheckPlayerInit(CCurrentStream& current, unsigned int source)
{
- if(current.startpts != DVD_NOPTS_VALUE
- && current.dts != DVD_NOPTS_VALUE)
+ if(current.inited)
+ return false;
+
+ if(current.startpts != DVD_NOPTS_VALUE)
{
+ if(current.dts == DVD_NOPTS_VALUE)
+ {
+ CLog::Log(LOGDEBUG, "%s - dropping packet type:%d dts:%f to get to start point at %f", __FUNCTION__, source, current.dts, current.startpts);
+ return true;
+ }
+
if((current.startpts - current.dts) > DVD_SEC_TO_TIME(20))
{
CLog::Log(LOGDEBUG, "%s - too far to decode before finishing seek", __FUNCTION__);
@@ -1508,19 +1516,15 @@ bool CDVDPlayer::CheckPlayerInit(CCurrentStream& current, unsigned int source)
m_CurrentTeletext.startpts = current.dts;
}
- if(current.startpts <= current.dts)
- current.startpts = DVD_NOPTS_VALUE;
- }
-
- // await start sync to be finished
- if(current.startpts != DVD_NOPTS_VALUE)
- {
- CLog::Log(LOGDEBUG, "%s - dropping packet type:%d dts:%f to get to start point at %f", __FUNCTION__, source, current.dts, current.startpts);
- return true;
+ if(current.dts < current.startpts)
+ {
+ CLog::Log(LOGDEBUG, "%s - dropping packet type:%d dts:%f to get to start point at %f", __FUNCTION__, source, current.dts, current.startpts);
+ return true;
+ }
}
//If this is the first packet after a discontinuity, send it as a resync
- if (current.inited == false && current.dts != DVD_NOPTS_VALUE)
+ if (current.dts != DVD_NOPTS_VALUE)
{
current.inited = true;
current.startpts = current.dts;
@@ -1550,7 +1554,7 @@ bool CDVDPlayer::CheckPlayerInit(CCurrentStream& current, unsigned int source)
starttime = m_CurrentVideo.startpts;
starttime = current.startpts - starttime;
- if(starttime > 0)
+ if(starttime > 0 && setclock)
{
if(starttime > DVD_SEC_TO_TIME(2))
CLog::Log(LOGWARNING, "CDVDPlayer::CheckPlayerInit(%d) - Ignoring too large delay of %f", source, starttime);
@@ -1653,7 +1657,7 @@ bool CDVDPlayer::CheckSceneSkip(CCurrentStream& current)
if(current.dts == DVD_NOPTS_VALUE)
return false;
- if(current.startpts != DVD_NOPTS_VALUE)
+ if(current.inited == false)
return false;
CEdl::Cut cut;
@@ -1676,8 +1680,8 @@ void CDVDPlayer::CheckAutoSceneSkip()
* If there is a startpts defined for either the audio or video stream then dvdplayer is still
* still decoding frames to get to the previously requested seek point.
*/
- if(m_CurrentAudio.startpts != DVD_NOPTS_VALUE
- || m_CurrentVideo.startpts != DVD_NOPTS_VALUE)
+ if(m_CurrentAudio.inited == false
+ || m_CurrentVideo.inited == false)
return;
if(m_CurrentAudio.dts == DVD_NOPTS_VALUE
Please sign in to comment.
Something went wrong with that request. Please try again.