[Ffmpeg-devel] Re: [PATCH] closed gop flag change

Michael Niedermayer michaelni
Fri Jun 9 10:34:54 CEST 2006


Hi

On Fri, Jun 09, 2006 at 01:47:12AM +0200, Baptiste COUDURIER wrote:
> M?ns Rullg?rd wrote:
> > Baptiste COUDURIER <baptiste.coudurier at smartjog.com> writes:
> > 
> >> M?ns Rullg?rd wrote:
> >>> Baptiste COUDURIER <baptiste.coudurier at smartjog.com> writes:
> >>>
> >>>> Hi,
> >>>>
> >>>> CODEC_FLAG_CLOSED_GOP value is too high to be taken into account. Patch
> >>>> changes value to CODEC_FLAG2_CLOSED_GOP and now uses flags2.
> >>> [...]
> >>>
> >>>> -#define CODEC_FLAG_CLOSED_GOP     0x80000000
> >>> What are you talking about?  That's using no more than 32 bits.
> >>>
> >> {name = 0x8389ea9 "cgop", help = 0x8389eae "closed gop", offset = 0,
> >> type = FF_OPT_TYPE_CONST, default_val = 2147483648, min = -2147483648,
> >> max = 2147483647,
> >>
> >> 0x80000000 > INT_MAX, avctx->flags is "int".
> >>
> >> No ? Am I missing something ?
> > 
> > OK, there appears to be a problem.  The solution is to make variable
> > unsigned.  That will not break existing code.
> > 
> 
> Well, after investigation it seems that changing avctx->flags and
> s->flags is not the only needed change, I guess opt.c has to be modified
> as well. I see casts here and there:
> 
> switch(o->type){
>     case FF_OPT_TYPE_FLAGS:
>     case FF_OPT_TYPE_INT:   *(int *)dst= lrintf(num/den)*intnum; break;
> 
> but casting here does not change anything.
> 
> Can someone more familiar to opt.c give me some hints ? Michael ?

replace 
#define CODEC_FLAG_CLOSED_GOP     0x80000000
with
((int)0x80000000) or equivalent

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is




More information about the ffmpeg-devel mailing list