Commit ea25c063 authored by Justin Ruggles's avatar Justin Ruggles

10l: set genre default immediately before reading genre tag

Originally committed as revision 19867 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent d891cbb4
...@@ -193,12 +193,12 @@ static int id3v1_create_tag(AVFormatContext *s, uint8_t *buf) ...@@ -193,12 +193,12 @@ static int id3v1_create_tag(AVFormatContext *s, uint8_t *buf)
count += id3v1_set_string(s, "album", buf + 63, 30); count += id3v1_set_string(s, "album", buf + 63, 30);
count += id3v1_set_string(s, "year", buf + 93, 4); count += id3v1_set_string(s, "year", buf + 93, 4);
count += id3v1_set_string(s, "comment", buf + 97, 30); 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))) { if ((tag = av_metadata_get(s->metadata, "track", NULL, 0))) {
buf[125] = 0; buf[125] = 0;
buf[126] = atoi(tag->value); buf[126] = atoi(tag->value);
count++; count++;
} }
buf[127] = 0xFF; /* default to unknown genre */
if ((tag = av_metadata_get(s->metadata, "genre", NULL, 0))) { if ((tag = av_metadata_get(s->metadata, "genre", NULL, 0))) {
for(i = 0; i <= ID3v1_GENRE_MAX; i++) { for(i = 0; i <= ID3v1_GENRE_MAX; i++) {
if (!strcasecmp(tag->value, ff_id3v1_genre_str[i])) { if (!strcasecmp(tag->value, ff_id3v1_genre_str[i])) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment