[libav-bugs] [Bug 651] New: reports incorrect album metadata

bugzilla at libav.org bugzilla at libav.org
Wed Mar 12 18:48:34 CET 2014


https://bugzilla.libav.org/show_bug.cgi?id=651

           Summary: reports incorrect album metadata
           Product: Libav
           Version: git HEAD
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: Normal
         Component: libavformat
        AssignedTo: bugzilla at libav.org
        ReportedBy: superjoe30 at gmail.com


Example media: http://superjoe.s3.amazonaws.com/temp/01%20Supremacy.mp3

git HEAD is currently at 5a7f382a5d

Example code:

#include <stdio.h>

#include <libavformat/avformat.h>
#include <libavutil/dict.h>

int main (int argc, char **argv)
{
    AVFormatContext *fmt_ctx = NULL;
    AVDictionaryEntry *tag = NULL;
    int ret;

    if (argc != 2) {
        printf("usage: %s <input_file>\n"
               "example program to demonstrate the use of the libavformat
metadata API.\n"
               "\n", argv[0]);
        return 1;
    }

    av_register_all();
    if ((ret = avformat_open_input(&fmt_ctx, argv[1], NULL, NULL)))
        return ret;

    while ((tag = av_dict_get(fmt_ctx->metadata, "", tag,
AV_DICT_IGNORE_SUFFIX)))
        printf("%s=%s\n", tag->key, tag->value);

    AVDictionaryEntry *entry = av_dict_get(fmt_ctx->metadata, "album", NULL,
AV_DICT_IGNORE_SUFFIX);
    printf("album=%s\n", entry->value);

    avformat_free_context(fmt_ctx);
    return 0;
}




Note that this is the same as doc/examples/metadata.c with these two lines
added:

    AVDictionaryEntry *entry = av_dict_get(fmt_ctx->metadata, "album", NULL,
AV_DICT_IGNORE_SUFFIX);
    printf("album=%s\n", entry->value);


Actual output:
$ ./test ~/tmp/01\ Supremacy.mp3 
title=Supremacy
genre=Alternative Rock
track=1/13
artist=Muse
album_artist=Muse
copyright=2012 Warner Music UK Limited
disc=1/1
album=The 2nd Law
date=2012
album=Muse


Expected output:
$ ./test ~/tmp/01\ Supremacy.mp3 
title=Supremacy
genre=Alternative Rock
track=1/13
artist=Muse
album_artist=Muse
copyright=2012 Warner Music UK Limited
disc=1/1
album=The 2nd Law
date=2012
album=The 2nd Law


So the album is correct when listing all dictionary items, but incorrect when
directly querying the album.

-- 
Configure bugmail: https://bugzilla.libav.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.


More information about the libav-bugs mailing list