[FFmpeg-devel] [PATCH] Add IFF metadata handling

Sebastian Vater cdgs.basty
Mon May 3 21:20:32 CEST 2010


Ronald S. Bultje a ?crit :
> Hi,
>
> On Mon, May 3, 2010 at 2:48 PM, Sebastian Vater
> <cdgs.basty at googlemail.com> wrote:
>   
>> Reason is that I figured out that the original code didn't check even if
>> get_buffer succeeds...
>> I have changed the metadata handling in a way it returns an appreciate
>> I/O error instead.
>>     
> [..]
>   
>> +            if ((res = get_metadata(s, "comment", data_size)) < 0) {
>> +                av_log(s, AV_LOG_ERROR, "iff: cannot allocate metadata for comments!");
>> +                return res;
>> +            }
>> +            break;
>> +
>> +        case ID_AUTH:
>> +            if ((res = get_metadata(s, "artist", data_size)) < 0) {
>> +                av_log(s, AV_LOG_ERROR, "iff: cannot allocate metadata for author!");
>> +                return res;
>> +            }
>>     
>
> I don't think the user cares which metadata failed, and that means
> you're duplicating lots of code here and below.
>   

I'm not sure, I thought the same way before, but then I realized that
somebody might be running this in a huge batch task (converting images,
etc.) and doesn't want such errors silently be skipped.

> case ID_AUTH: m = "artist"; break;
> case ID_COMMENT: m = "comment"; break;
> if (get_metadata()) {
>   log();
>   return;
> }
>   

This, is a pretty good idea, indeed and I supply a new patch for this.

-- 

Best regards,
                   :-) Basty/CDGS (-:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: iff-metadata.patch
Type: text/x-patch
Size: 2382 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100503/1b0886e2/attachment.bin>



More information about the ffmpeg-devel mailing list