[Ffmpeg-devel] [PATCH] wrong use of ff_get_fourcc in mpjg.c

Reimar Doeffinger Reimar.Doeffinger
Wed Feb 7 13:29:01 CET 2007


Hello,
On Wed, Feb 07, 2007 at 12:08:10PM -0000, M?ns Rullg?rd wrote:
> Baptiste Coudurier said:
> > Michael Niedermayer wrote:
> >> On Wed, Feb 07, 2007 at 11:18:07AM +0100, Reimar Doeffinger wrote:
> >>> attached patch fixes bug 739 by using the much more obvious to
> >>> understand MKBETAG.
> >>
> >> ok
> >>
> >>
> >>> I think this is not the first bug of this kind caused by this functions,
> >>> indicating it that it is flawed in so far as it has non-obvious
> >>> semantics, so may I suggest deprecating it?
> >>
> >> what about replacing all
> >> MK*TAG and ff_get_fourcc by
> >>
> >> AV_RB32("ABCD") / AV_RL32("ABCD") ?
> >>
> >> assuming of course that the compiler can optimize this into similarely
> >> simple code ...
> >>
> >
> > I like MKTAG, which illustrates that we are looking for a tag rather
> > than a serie of bytes. MKTAG("ABCD") would be nice though.
> 
> The trouble is that such constructs can't be used where a constant expression
> is required, for instance in case labels.  The MKTAG macros tend to be used
> quite a lot in such places.

AV_RB32 etc. in general when there are optimized variants maybe not, but a macro
that expands to
("ABCD")[0] | (("ABCD")[1] << 8) ...
I'd expect to resolve to a constant...

Greetings,
Reimar Doeffinger




More information about the ffmpeg-devel mailing list