[FFmpeg-soc] [soc]: r2973 - mxf/mxfenc.c

Baptiste Coudurier baptiste.coudurier at smartjog.com
Fri Aug 1 20:51:47 CEST 2008


Hi,

Michael Niedermayer wrote:
> On Sat, Aug 02, 2008 at 01:22:26AM +0800, zhentan feng wrote:
>> Hi
>>
>> 2008/8/2 Michael Niedermayer <michaelni at gmx.at>
>>
>>> On Fri, Aug 01, 2008 at 06:55:59PM +0200, spyfeng wrote:
>>>> Author: spyfeng
>>>> Date: Fri Aug  1 18:55:59 2008
>>>> New Revision: 2973
>>>>
>>>> Log:
>>>> remove malloc mem for mxf->track_number_sign.
>>>> use static array instead.
>>> [...]
>>>> +static
>>> track_number_sign[sizeof(mxf_essence_element_key)/sizeof(MXFEssenceElementKey)]
>>> = { 0 };
>>> [...]
>>>> @@ -627,8 +624,8 @@ static int mxf_write_track(AVFormatConte
>>>>              if (st->codec->codec_id== element->type) {
>>>>                  // write track number
>>>>                  put_buffer(pb, element->uid + 12, 3);
>>>> -                put_byte(pb, element->uid[15] +
>>> mxf->track_number_sign[i]);
>>>> -                mxf->track_number_sign[i] ++;
>>>> +                put_byte(pb, element->uid[15] + track_number_sign[i]);
>>>> +                track_number_sign[i] ++;
>>> static arrays must be constant, it should be in the struct but not malloced
>>>
>> ok.
>> but if this, I should move MXFContext defination under the static tables
>> because the size of the arrary depend mxf_essence_element_key. It will looks
>> like a little ugly ;)
> 
> umm, i see, well a variable static array is definitly not ok.
> maybe a local array in mxf_build_structural_metadata() would be
> a possibility?
> Or maybe baptiste has some better idea?
> 

Not really, local array seems the solution.

Also I suggest also to set AVStream->priv_data to some structure where
you will have to store per track informations like duration anyway, so
zhentan should remove these fields from main context.

-- 
Baptiste COUDURIER                              GnuPG Key Id: 0x5C1ABAAA
Smartjog USA Inc.                                http://www.smartjog.com
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA



More information about the FFmpeg-soc mailing list