[mythtv] commflag debugging

Chris Pinkham cpinkham at bc2va.org
Tue Jan 3 16:01:44 EST 2006


> Thanks that helped alot.  So debugging stuff commflag is correctly finding 
> the commercials, but something weird is going on during playback.  The 
> actual video frames and frame numbers are not matching up between 
> mythcommflag and mythfrontend.  
> 
> In the main recording I have been looking at commflag finds the first 
> break as frame 40130 (verified with your debugging code).  When this video 
> frame (not number) shows up in mythfrontend its frame number 37319.  This 
> of course screws up commbreak skips, when mythfrontend get to what it 
> calls frame #40130 ist no where near the commercial.

mythcommflag gets its frame numbers from the frames themselves using this:

	currentFrameNumber = currentFrame->frameNumber;

and those frame numbers come from the decoders.

A while back there were some issues with software-encoded .nuv files with
the frame numbers differing depending on whether you were playing through
the file frame-by-frame or skipping through the file.  The issue occured when
there was corruption in the file and there were skipped frames between
keyframes, for example with keyframedist = 15, but a few frames were skipped
and there were only 10 between 2 keyframes at one point.  I think this was
fixed for nuppeldecoder, but there could be an issue in avformatdecoder.cpp
as well.  From a quick look at the code, I see framesPlayed is explicitly
set in AvFormatDecoder::DoFastForward(), SeekReset(), and Reset(), and it is
incremented in AvFormatDecoder::GetFrame() on every video frame decoded.

This might explain the discrepancy between the framesPlayed you get in
mythcommflag which "plays" frame-by-frame through the video and the
framesPlayed you get in mythfrontend after seeking once.

-- 
Chris



More information about the mythtv-dev mailing list