[Ffmpeg-devel] [PATCH] Matroska keep extradata for some codec

Steve Lhomme slhomme
Mon Nov 6 21:06:56 CET 2006


Michael Niedermayer wrote:
> Hi
> 
> On Mon, Nov 06, 2006 at 07:23:34PM +0100, Steve Lhomme wrote:
>> Hi,
>>
>> As the title suggests... The extradata are used by some codec. AAC is 
>> not handled because we don't support it cleanly enough for now.
> 
> this patch confuses me a little, currently we have
> 
>             void *extradata = NULL;
>             int extradata_size = 0;
> 
> then, no matches for extradata except
> 
>             if(extradata){
>                 st->codec->extradata = extradata;
>                 st->codec->extradata_size = extradata_size;
>             } else if(track->codec_priv && track->codec_priv_size > 0){
>                 st->codec->extradata = av_malloc(track->codec_priv_size);
>                 if(st->codec->extradata == NULL)
>                     return AVERROR_NOMEM;
>                 st->codec->extradata_size = track->codec_priv_size;
>                 memcpy(st->codec->extradata, track->codec_priv,
>                        track->codec_priv_size);
>             }
> 
> so what does your code change? it seems to change nothing, as it looks
> like we already set extradata

Well, if you look again at the code you pasted, the 1st part of the 'if' 
is never used so far. And you're right that for the cases I added it's 
useless, as the same code is done in the second part of the 'if'. So 
this patch can be discarded. The first part of the 'if' has to remain 
though as for certain codecs (AAC for example) the extradata are 
generated and not just read from the file. I'll try to submit patches to 
use that code.

Steve




More information about the ffmpeg-devel mailing list