[FFmpeg-devel] [PATCH 2/3] id3v2: convert metadata after all the tags were read

Måns Rullgård mans
Thu Jan 20 14:37:58 CET 2011


Anton Khirnov <anton at khirnov.net> writes:

> ---
>  libavformat/id3v2.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/libavformat/id3v2.c b/libavformat/id3v2.c
> index 9e748b5..715b8f6 100644
> --- a/libavformat/id3v2.c
> +++ b/libavformat/id3v2.c
> @@ -256,7 +256,6 @@ static void ff_id3v2_parse(AVFormatContext *s, int len, uint8_t version, uint8_t
>          /* Skip to end of tag */
>          url_fseek(s->pb, next, SEEK_SET);
>      }
> -    ff_metadata_conv(&s->metadata, NULL, ff_id3v2_metadata_conv);
>
>      if (len > 0) {
>          /* Skip padding */
> @@ -286,7 +285,7 @@ void ff_id3v2_read(AVFormatContext *s, const char *magic)
>          off = url_ftell(s->pb);
>          ret = get_buffer(s->pb, buf, ID3v2_HEADER_SIZE);
>          if (ret != ID3v2_HEADER_SIZE)
> -            return;
> +            break;
>              found_header = ff_id3v2_match(buf, magic);
>              if (found_header) {
>              /* parse ID3v2 header */
> @@ -299,6 +298,7 @@ void ff_id3v2_read(AVFormatContext *s, const char *magic)
>              url_fseek(s->pb, off, SEEK_SET);
>          }
>      } while (found_header);
> +    ff_metadata_conv(&s->metadata, NULL, ff_id3v2_metadata_conv);
>  }

Makes sense, queued.

-- 
M?ns Rullg?rd
mans at mansr.com



More information about the ffmpeg-devel mailing list