From 5da78c8489624236f54048b07bf8c931c543f679 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Sat, 6 Jun 2009 02:15:05 +0100 Subject: [PATCH] libgsttag: don't extract genres from empty ID3v1 tags If we don't have any other info, don't try to interpret the genre field. In particular we don't want to interpret a genre of 0 as 'Blues' if no other fields are set and the entire tag is just empty. --- gst-libs/gst/tag/gstid3tag.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gst-libs/gst/tag/gstid3tag.c b/gst-libs/gst/tag/gstid3tag.c index f50988e..e400894 100644 --- a/gst-libs/gst/tag/gstid3tag.c +++ b/gst-libs/gst/tag/gstid3tag.c @@ -391,7 +391,7 @@ gst_tag_list_new_from_id3v1 (const guint8 * data) gst_tag_extract_id3v1_string (list, GST_TAG_COMMENT, (gchar *) & data[97], 30); } - if (data[127] < gst_tag_id3_genre_count ()) { + if (data[127] < gst_tag_id3_genre_count () && !gst_tag_list_is_empty (list)) { gst_tag_list_add (list, GST_TAG_MERGE_REPLACE, GST_TAG_GENRE, gst_tag_id3_genre_get (data[127]), NULL); } -- 2.7.4