asfdemux: nicer metadata extraction of genre tags in some cases

Handle pseudo-strings like "(5)" and map them to the ID3v1 genre
that they presumably stand for.
This commit is contained in:
Tim-Philipp Müller 2009-06-05 01:51:20 +01:00
parent 2aeecee037
commit 181db09d90

View file

@ -2276,6 +2276,16 @@ gst_asf_demux_process_ext_content_desc (GstASFDemux * demux, guint8 * data,
gst_value_set_date (&tag_value, date); gst_value_set_date (&tag_value, date);
g_date_free (date); g_date_free (date);
} }
} else if (strcmp (gst_tag_name, GST_TAG_GENRE) == 0) {
guint id3v1_genre_id;
const gchar *genre_str;
if (sscanf (value_utf8, "(%u)", &id3v1_genre_id) == 1 &&
((genre_str = gst_tag_id3_genre_get (id3v1_genre_id)))) {
GST_DEBUG ("Genre: %s -> %s", value_utf8, genre_str);
g_free (value_utf8);
value_utf8 = g_strdup (genre_str);
}
} else { } else {
GType tag_type; GType tag_type;