From 181db09d901c004c8f77dc0f0878517090a84332 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Fri, 5 Jun 2009 01:51:20 +0100 Subject: [PATCH] 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. --- gst/asfdemux/gstasfdemux.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gst/asfdemux/gstasfdemux.c b/gst/asfdemux/gstasfdemux.c index cea2ce51da..ba8febaa84 100644 --- a/gst/asfdemux/gstasfdemux.c +++ b/gst/asfdemux/gstasfdemux.c @@ -2276,6 +2276,16 @@ gst_asf_demux_process_ext_content_desc (GstASFDemux * demux, guint8 * data, gst_value_set_date (&tag_value, 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 { GType tag_type;