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

Baptiste COUDURIER baptiste.coudurier
Fri Jun 9 01:47:12 CEST 2006


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 ?

-- 
Baptiste COUDURIER                              GnuPG Key Id: 0x5C1ABAAA
SMARTJOG S.A.                                    http://www.smartjog.com
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
Phone: +33 1 49966312





More information about the ffmpeg-devel mailing list