changeset 5198:7838e959a646 libavformat

10l: set genre default immediately before reading genre tag
author jbr
date Tue, 15 Sep 2009 23:40:10 +0000
parents 697f7bdaa43f
children fc6e05b7709d
files mp3.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mp3.c	Tue Sep 15 23:37:54 2009 +0000
+++ b/mp3.c	Tue Sep 15 23:40:10 2009 +0000
@@ -193,12 +193,12 @@
     count += id3v1_set_string(s, "album",   buf + 63, 30);
     count += id3v1_set_string(s, "year",    buf + 93,  4);
     count += id3v1_set_string(s, "comment", buf + 97, 30);
-    buf[127] = 0xFF; /* default to unknown genre */
     if ((tag = av_metadata_get(s->metadata, "track", NULL, 0))) {
         buf[125] = 0;
         buf[126] = atoi(tag->value);
         count++;
     }
+    buf[127] = 0xFF; /* default to unknown genre */
     if ((tag = av_metadata_get(s->metadata, "genre", NULL, 0))) {
         for(i = 0; i <= ID3v1_GENRE_MAX; i++) {
             if (!strcasecmp(tag->value, ff_id3v1_genre_str[i])) {