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

Ronald S. Bultje rsbultje
Mon May 3 20:53:22 CEST 2010


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.

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

Ronald



More information about the ffmpeg-devel mailing list