From 3721bc0a1c6c0b4b109abf61c24d91a2ce879e1f Mon Sep 17 00:00:00 2001 From: Gavin Hurlbut Date: Fri, 8 Apr 2011 12:48:30 -0700 Subject: [PATCH] Handle decoded frame number of -1 more gracefully 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. --- mythtv/libs/libmythtv/mythplayer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mythtv/libs/libmythtv/mythplayer.cpp b/mythtv/libs/libmythtv/mythplayer.cpp index 191360b49c0..b2a991b32c5 100644 --- a/mythtv/libs/libmythtv/mythplayer.cpp +++ b/mythtv/libs/libmythtv/mythplayer.cpp @@ -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) @@ -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;