Skip to content

Commit

Permalink
Fix DVD and Blu Ray seeking.
Browse files Browse the repository at this point in the history
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
Mark Kendall committed Nov 9, 2011
1 parent 31e9528 commit 088335b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions mythtv/libs/libmythtv/DVDRingBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions mythtv/libs/libmythtv/decoderbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() +
Expand Down Expand Up @@ -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() +
Expand Down

0 comments on commit 088335b

Please sign in to comment.