[FFmpeg-devel] [PATCH 1/3] lavf/id3v2 read COMM tag

Michael Niedermayer michaelni at gmx.at
Sun Jul 1 16:23:32 CEST 2012


On Sun, Jul 01, 2012 at 11:16:41AM +0200, Matthieu Bouron wrote:
> ---
>  libavformat/id3v2.c | 37 +++++++++++++++++++++++++++++++++++++
>  1 file changed, 37 insertions(+)
> 
> diff --git a/libavformat/id3v2.c b/libavformat/id3v2.c
> index 216d4a2..cb88858 100644
> --- a/libavformat/id3v2.c
> +++ b/libavformat/id3v2.c
> @@ -505,6 +505,42 @@ fail:
>      avio_seek(pb, end, SEEK_SET);
>  }
>  
> +static void read_comm(AVFormatContext *s, AVIOContext *pb, int taglen, char *tag, ID3v2ExtraMeta **extra_meta)
> +{
> +    uint8_t* dst = NULL;
> +    int64_t end = avio_tell(pb) + taglen;
> +    uint8_t encoding;
> +
> +    if (taglen <= 4)
> +        goto fail;
> +
> +    encoding = avio_r8(pb);
> +    taglen--;
> +
> +    // Read lang
> +    avio_rb24(pb);

why is the language code discarded ?


> +    taglen -= 3;
> +
> +    // Read short description
> +    if (decode_str(s, pb, encoding, &dst, &taglen) < 0) {
> +        av_log(s, AV_LOG_ERROR, "Error reading short description in COMM frame\n");
> +        goto fail;
> +    }
> +    av_freep(&dst);

why is the short description discarded ?


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Many things microsoft did are stupid, but not doing something just because
microsoft did it is even more stupid. If everything ms did were stupid they
would be bankrupt already.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120701/da41a0bc/attachment.asc>


More information about the ffmpeg-devel mailing list