Skip to content

Commit

Permalink
Handle decoded frame number of -1 more gracefully
Browse files Browse the repository at this point in the history
Fixes #9699.  The proposed fix in the ticket has been implemented.  As the
frameNumber can be -1, the type of lastDecodedFrameNumber must be signed.  This
is to fix a premature exit during transcoding, but it quite likely could rear
its ugly head in other contexts too.

A better permanent fix would be to treat the special case of frameNumber == -1
and deal with it specifically.

Thanks to ghaushe for the find.
  • Loading branch information
Beirdo committed Apr 8, 2011
1 parent d2e85ed commit 3721bc0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mythtv/libs/libmythtv/mythplayer.cpp
Expand Up @@ -4217,7 +4217,7 @@ bool MythPlayer::TranscodeGetNextFrame(
player_ctx->playingInfo->UpdateInUseMark();
player_ctx->UnlockPlayingInfo(__FILE__, __LINE__);

uint64_t lastDecodedFrameNumber =
int64_t lastDecodedFrameNumber =
videoOutput->GetLastDecodedFrame()->frameNumber;

if ((lastDecodedFrameNumber == 0) && honorCutList)
Expand All @@ -4237,7 +4237,7 @@ bool MythPlayer::TranscodeGetNextFrame(

if (honorCutList && !deleteMap.IsEmpty())
{
if (totalFrames && lastDecodedFrameNumber >= totalFrames)
if (totalFrames && lastDecodedFrameNumber >= (int64_t)totalFrames)
return false;

uint64_t jumpto = 0;
Expand Down

0 comments on commit 3721bc0

Please sign in to comment.