Permalink
Browse files

Fix DVD and Blu Ray seeking.

The main problem here was that when paused, the seek position would
fallback to the current speed (i.e. 0) and playback would resume from
the beginning of the title.

With DVD playback, we were also asking the dvdnav object to seek to the
nearest cell - which led to some sizeable search discrepancies depending
where playback was relative to the nearest cell. We now ask for a more
accurate search.

Backported from master 4b0803b

Fixes #9305
  • Loading branch information...
1 parent 31e9528 commit 088335b4bd8147a1f33aca8f7fb62a73fdc88e34 Mark Kendall committed Nov 9, 2011
Showing with 4 additions and 4 deletions.
  1. +2 −2 mythtv/libs/libmythtv/DVDRingBuffer.cpp
  2. +2 −2 mythtv/libs/libmythtv/decoderbase.cpp
@@ -111,7 +111,7 @@ long long DVDRingBufferPriv::Seek(long long time)
if (m_parent)
ffrewSkip = m_parent->GetFFRewSkip();
- if (ffrewSkip != 1 && time != 0)
+ if (ffrewSkip != 1 && ffrewSkip != 0 && time != 0)
{
QMap<uint, uint>::const_iterator it = m_seekSpeedMap.lowerBound(labs(time));
if (it == m_seekSpeedMap.end())
@@ -125,7 +125,7 @@ long long DVDRingBufferPriv::Seek(long long time)
else
{
m_seektime = (uint64_t)time;
- dvdRet = dvdnav_absolute_time_search(m_dvdnav, m_seektime, 1);
+ dvdRet = dvdnav_absolute_time_search(m_dvdnav, m_seektime, 0);
}
VERBOSE(VB_PLAYBACK+VB_EXTRA,
@@ -865,7 +865,7 @@ long long DecoderBase::DVDFindPosition(long long desiredFrame)
current_speed = (int)m_parent->GetNextPlaySpeed();
}
- if (ffrewSkip == 1)
+ if (ffrewSkip == 1 || ffrewSkip == 0)
{
diffTime = (int)ceil((desiredFrame - framesPlayed) / fps);
desiredTimePos = ringBuffer->DVD()->GetCurrentTime() +
@@ -896,7 +896,7 @@ long long DecoderBase::BDFindPosition(long long desiredFrame)
current_speed = (int)m_parent->GetNextPlaySpeed();
}
- if (ffrewSkip == 1)
+ if (ffrewSkip == 1 || ffrewSkip == 0)
{
diffTime = (int)ceil((desiredFrame - framesPlayed) / fps);
desiredTimePos = ringBuffer->BD()->GetCurrentTime() +

0 comments on commit 088335b

Please sign in to comment.