]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/id3v1.c
Optimize/simplify ebml_read_num.
[ffmpeg] / libavformat / id3v1.c
index 09172ae0a2b0f8e225179049edf49426f04ea810..c72fca49cb2c516bc43d1be37e1ec9fd5f8d5c26 100644 (file)
@@ -91,7 +91,7 @@ const char * const ff_id3v1_genre_str[ID3v1_GENRE_MAX + 1] = {
      [64] = "Native American",
      [65] = "Cabaret",
      [66] = "New Wave",
-     [67] = "Psychedelic",
+     [67] = "Psychadelic",
      [68] = "Rave",
      [69] = "Showtunes",
      [70] = "Trailer",
@@ -192,7 +192,7 @@ static void get_string(AVFormatContext *s, const char *key,
     *q = '\0';
 
     if (*str)
-        av_metadata_set(&s->metadata, key, str);
+        av_metadata_set2(&s->metadata, key, str, 0);
 }
 
 /**
@@ -211,13 +211,13 @@ static int parse_tag(AVFormatContext *s, const uint8_t *buf)
     get_string(s, "title",   buf +  3, 30);
     get_string(s, "artist",  buf + 33, 30);
     get_string(s, "album",   buf + 63, 30);
-    get_string(s, "year",    buf + 93,  4);
+    get_string(s, "date",    buf + 93,  4);
     get_string(s, "comment", buf + 97, 30);
     if (buf[125] == 0 && buf[126] != 0)
         av_metadata_set2(&s->metadata, "track", av_d2str(buf[126]), AV_METADATA_DONT_STRDUP_VAL);
     genre = buf[127];
     if (genre <= ID3v1_GENRE_MAX)
-        av_metadata_set(&s->metadata, "genre", ff_id3v1_genre_str[genre]);
+        av_metadata_set2(&s->metadata, "genre", ff_id3v1_genre_str[genre], 0);
     return 0;
 }