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.
This commit is contained in:
Tim-Philipp Müller 2009-06-06 02:15:05 +01:00
parent ef1030ee6e
commit 5da78c8489

View file

@ -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);
}