[FFmpeg-devel] [PATCH] ADTS AAC with ID3v2

David DeHaven dave
Fri Jan 23 17:51:33 CET 2009


>> +    uint8_t buf[ID3v2_HEADER_SIZE];
>> +    int ret;
>
> these ones could be moved where they're used

Odd, I did re-scope them... I should have re-attached the patch when I  
updated. My mistake.


>>     AVStream *st = av_new_stream(s, 0);
>>     if (!st)
>>         return AVERROR(ENOMEM);
>> @@ -289,6 +291,20 @@
>>     st->codec->codec_id = s->iformat->value;
>>     st->need_parsing = AVSTREAM_PARSE_FULL;
>>     /* the parameters will be extracted from the compressed  
>> bitstream */
>> +
>> +    if(st->codec->codec_id == CODEC_ID_FLAC) {
>> +        /* skip ID3v2 header if found */
>> +        ret = get_buffer(s->pb, buf, ID3v2_HEADER_SIZE);
>> +        if (ret != ID3v2_HEADER_SIZE)
>> +            return -1;
>
> isn't it possible that ret is not ID3v2_HEADER_SIZE long and the file
> still is a valid flac file ?

Good point... though I rather doubt a flac file of less than 10 bytes  
is very useful :)


>> +    if(memcmp(bptr, "fLaC", 4)) return 0;
>> +    else                        return AVPROBE_SCORE_MAX / 2;
>
> this mixes cosmetics and functionnal changes.

Tell you what, I'll change bptr to bufptr and avoid the cosmically  
huge cosmetic change of deleting two spaces.

Update attached.

-DrD-

-------------- next part --------------
A non-text attachment was scrubbed...
Name: flac_id3.patch
Type: application/octet-stream
Size: 1255 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090123/8c79f274/attachment.obj>
-------------- next part --------------






More information about the ffmpeg-devel mailing list