[gst-cvs] gst-plugins-ugly: asfdemux: nicer metadata extraction of genre tags in some cases
Tim Mueller
tpm at kemper.freedesktop.org
Thu Jun 4 17:56:50 PDT 2009
Module: gst-plugins-ugly
Branch: master
Commit: 181db09d901c004c8f77dc0f0878517090a84332
URL: http://cgit.freedesktop.org/gstreamer/gst-plugins-ugly/commit/?id=181db09d901c004c8f77dc0f0878517090a84332
Author: Tim-Philipp Müller <tim.muller at collabora.co.uk>
Date: Fri Jun 5 01:51:20 2009 +0100
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 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/gst/asfdemux/gstasfdemux.c b/gst/asfdemux/gstasfdemux.c
index cea2ce5..ba8feba 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;
More information about the Gstreamer-commits
mailing list