[mythtv] [PATCH] position map using frame numbers, rev 2

Bruce Markey bjm at lvcm.com
Thu Dec 18 04:00:45 EST 2003


David Engel wrote:
> On Mon, Dec 15, 2003 at 05:34:41PM -0800, Bruce Markey wrote:
> 
>>I believe this is because FramesPlayed is something more like
>>frames decoded and doesn't account for the frames in the
>>vbuffers. In other words, when FramesPlayed is 100 the frame
>>shown from normal playback is 980. Left arrow decodes and
>>displays 99 which is nearly a second later than the pause
>>when entering edit mode.
> 
> 
> I think this is mainly due to frame numbers (e.g. desiredFrame) being
> 0-based and framesPlayed, effectively, being 1-based.  For example,
> when DoFastForward says go to desiredFrame=1000, it implies showing
> the frame when framesPlayed == 1001.  I know I was confused by this
> when working on the ivtvdecoder.  It makes it easy to have an
> off-by-one error.  Or should that be an off-by-gop error?

Either would be better than my off by 900 error in typing the
example above ;-).

Someone (and it may have even been you) mentioned last summer
that they noticed that if you pause during a pitcher's windup
then step forward, the ball will instantly be in the catcher's
glove.  Shortly after, I was mucking with something else and
was printing FramesPlayed and noticed that the first step back
correctly subtracted 1 from the FramesPlayed value but the frame
shown was nearly one second later than the freeze frame. You
can clearly see this by playing something with obvious motion
or scene change. Press "P" then left arrow. It jumps forward
nearly one second.

At the time I was pretty sure that I'd tracked it down to the
fact that FramesPlayed was counting the frames that had been
decoded and sent to the vbuffer but the frame shown was
FramesPlayed minus the number of frames in the vbuffer.

I thought I could fix it by subtracting what is now 
ValidVideoFrames() but getting hold of this value didn't turn
out to be as easy as I'd hoped and this wasn't the problem that
I was trying to fix at the time so I gave up on it.

--  bjm






More information about the mythtv-dev mailing list