[FFmpeg-devel] [PATCH] MpegEncContext must be initialized before calling ff_h263_decode_init
Reimar Döffinger
Reimar.Doeffinger
Sat Jun 27 14:28:11 CEST 2009
On Sat, Jun 27, 2009 at 12:52:48PM +0300, Kostya wrote:
> On Sat, Jun 27, 2009 at 11:19:48AM +0200, Reimar D?ffinger wrote:
> > Hello,
> > ff_h263_decode_init calls MPV_common_init which then need mb_width to
> > calculate mb_stride.
> > So my conclusion is, MpegEncContext needs to be initialized before
> > calling this function.
> > This is probably what issue1233 is about.
>
> Hmm, I don't like it.
> Those values were initialized after decoder has read WMV3/VC-1 sequence
> header and set correct values which may differ from previous ones.
Huh? I tried to check that and didn't see that they got changed.
Calling ff_h263_decode_init again, afterwards or something like that
might work, too, or disabling the MPV_common_init in it for
VC1 or whatever, but the current code is just plain wrong...
Also, if someone investigates it, that someone should also add
documentation which values need to be set before calling them,
because it is currently just impossible to see what would be a possible
correct order, e.g. which values does ff_h263_decode_init need to be
set, what are you supposed to do when they change during run-time (e.g.
two raw VC1 streams concatenated), do those vc1 function that are called
in this function actually need a proper MpegEncContext or could we just
initialize it afterwards, what happens when MPV_common_init is called
twice on the same struct etc. pp.
It would be really great if someone had the time to improve the
documentation, it is quite unfortunate that the complex MPEG stuff is
the absolutely most horrible code in terms of documentation IMHO.
More information about the ffmpeg-devel
mailing list