[mythtv] Aspect Change problems

Edward Wildgoose edward.wildgoose at frmhedge.com
Sun Nov 23 13:33:25 EST 2003


> Here's a bit more detail on what I found about the DVB(/ HDTV?) jitter
last
> week.
>
> The primary cause of the jitter I observed is that avcodec_decode_video()
> sometimes provides the same VideoFrame * more than once  without that
frame
> having been re-obtained through AVCodecContext::get_buffer() in the
interim.
> This results in multiple pointers to the same frame in the
> VideoOutput::availableVideoBuffers/usedVideoBuffers pair. It's then
possible
> for libavdecodec to fill a frame through one of the pointers to it
> while another pointer to it is in usedVideoBuffers awaiting display -
> effectively
> overwriting the queued frame with one 'from the future' and resulting in
an
> out of sequence frame. Out of sequence frames will reoccur about once a
> second, depending on how many vbuffers are allocated in
> VideoOutput::InitBuffers() and how libavcodec fills them.

Aha, that makes a lot of sense based on what others have said as well!

However, why would this be causing a problem for the case of the aspect
ratio change situation.  The code in question which triggers the problem
seems to be flushing buffers.  What might be causing duplicate frames to be
occuring here?

The other (very minor) problem with the current aspect ratio changing code
is that it's triggered when the frame is being read, rather than when the
frame is being displayed.  This means a momentary, change to the new ratio
for a few frames which should really be in the old ratio before everything
displays correctly again.  Anyway, quite bearable, but just pointing it out.

Thanks all

Ed W



More information about the mythtv-dev mailing list