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

Steve Lhomme slhomme
Mon Nov 6 21:09:15 CET 2006



M?ns Rullg?rd wrote:
> Steve Lhomme <slhomme at divxcorp.com> writes:
> 
>> 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.
>>
>> Steve
>> Index: libavformat/matroska.c
>> ===================================================================
>> --- libavformat/matroska.c	(revision 6884)
>> +++ libavformat/matroska.c	(working copy)
>> @@ -2196,6 +2196,20 @@
>>
>>              }
>>
>> +            else if (codec_id == CODEC_ID_RV40 ||
>> +                     codec_id == CODEC_ID_RV30 ||
>> +                     codec_id == CODEC_ID_RV20 ||
>> +                     codec_id == CODEC_ID_RV10 ||
>> +                     codec_id == CODEC_ID_VORBIS) {
>> +                extradata_size = track->codec_priv_size;
>> +                if(extradata_size) {
>> +                    extradata = av_malloc(extradata_size);
>> +                    if(extradata == NULL)
>> +                        return AVERROR_NOMEM;
>> +                    memcpy(extradata, track->codec_priv, extradata_size);
>> +                }
>> +            }
>> +
> 
> Why not always save the extradata if there is some?

As Michael pointed out it's already done. But that's actually dangerous 
because some codec may have some extradata in the matroska stream, but 
the way these data are put may not correspond to the data FFMPEG expects.

Anyway, this patch can be discarded.

Steve






More information about the ffmpeg-devel mailing list