Skip to content

Commit

Permalink
Fixes #11141, a frame numbering mismatch in the commflagger.
Browse files Browse the repository at this point in the history
The mismatch is between the frame numbering for seeking and the frame
numbering for the video display.  Also, optimize the "seek to next
frame" case.

This only affects the "experimental" commflagger.
  • Loading branch information
stichnot committed Aug 5, 2013
1 parent d911198 commit 03a7667
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mythtv/programs/mythcommflag/CommDetector2.cpp
Expand Up @@ -598,9 +598,11 @@ bool CommDetector2::go(void)
struct timeval start, end, elapsedtv;

(void)gettimeofday(&start, NULL);
VideoFrame *currentFrame = player->GetRawVideoFrame(nextFrame);
bool fetchNext = (nextFrame == currentFrameNumber + 1);
VideoFrame *currentFrame =
player->GetRawVideoFrame(fetchNext ? -1 : nextFrame);
long long lastFrameNumber = currentFrameNumber;
currentFrameNumber = currentFrame->frameNumber;
currentFrameNumber = currentFrame->frameNumber + 1;
(void)gettimeofday(&end, NULL);
timersub(&end, &start, &elapsedtv);
timeradd(&getframetime, &elapsedtv, &getframetime);
Expand Down

0 comments on commit 03a7667

Please sign in to comment.