Skip to content

Commit

Permalink
Fix seeking after LiveTV transitions.
Browse files Browse the repository at this point in the history
After a LiveTV transition occured we were setting the max seek to
the amount of frames written by the recorder for the current
segment even though we were still playing a previous segment in the
LiveTV chain. Also, when seeking near the end of a segment we were
setting fftime to -1 which prevented further seeking due to an
incorrect comparison in FastForward.

Regs #9023.
  • Loading branch information
tralph committed Feb 1, 2011
1 parent 5aa72eb commit 3716894
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions mythtv/libs/libmythtv/mythplayer.cpp
Expand Up @@ -2172,7 +2172,7 @@ bool MythPlayer::FastForward(float seconds)
if (!videoOutput)
return false;

if (fftime >= 0)
if (fftime <= 0)
fftime = (long long)(seconds * video_frame_rate);
return fftime > CalcMaxFFTime(fftime, false);
}
Expand All @@ -2182,7 +2182,7 @@ bool MythPlayer::Rewind(float seconds)
if (!videoOutput)
return false;

if (rewindtime >= 0)
if (rewindtime <= 0)
rewindtime = (long long)(seconds * video_frame_rate);
return (uint64_t)rewindtime >= framesPlayed;
}
Expand Down Expand Up @@ -3446,8 +3446,11 @@ void MythPlayer::WaitForSeek(uint64_t frame, bool override_seeks,
(allpaused && !deleteMap.IsEditing()) ? true: after;
decoder->setExactSeeks(before);

bool islivetvcur = (livetv && player_ctx->tvchain &&
!player_ctx->tvchain->HasNext());

uint64_t max = totalFrames;
if ((livetv || (watchingrecording && player_ctx->recorder &&
if ((islivetvcur || (watchingrecording && player_ctx->recorder &&
player_ctx->recorder->IsValidRecorder())))
{
max = (uint64_t)player_ctx->recorder->GetFramesWritten();
Expand Down

0 comments on commit 3716894

Please sign in to comment.