From f960e4ca4d188c22707bd915b1090b69fbd190fa Mon Sep 17 00:00:00 2001 From: Stefan Kost Date: Thu, 7 Sep 2006 16:05:31 +0000 Subject: [PATCH] gst/asfdemux/gstasfdemux.c: Erm, lets properly fix it. The only non-text tag that we support is the track-number and ... Original commit message from CVS: * gst/asfdemux/gstasfdemux.c: (gst_asf_demux_get_gst_tag_from_tag_name), (gst_asf_demux_process_ext_content_desc): Erm, lets properly fix it. The only non-text tag that we support is the track-number and that is an UINT. asfdemux was returning a GValue initialized as INT. Further the Track and not the TrackNumber tag (the latter is a string too). --- ChangeLog | 10 ++++++++++ gst/asfdemux/gstasfdemux.c | 15 ++++++++------- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1af54febc0..4839536614 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2006-09-07 Stefan Kost + + * gst/asfdemux/gstasfdemux.c: + (gst_asf_demux_get_gst_tag_from_tag_name), + (gst_asf_demux_process_ext_content_desc): + Erm, lets properly fix it. The only non-text tag that we support is + the track-number and that is an UINT. asfdemux was returning a GValue + initialized as INT. Further the Track and not the TrackNumber tag + (the latter is a string too). + 2006-09-07 Stefan Kost * gst/asfdemux/gstasfdemux.c: diff --git a/gst/asfdemux/gstasfdemux.c b/gst/asfdemux/gstasfdemux.c index a9487a048b..8942943ef3 100644 --- a/gst/asfdemux/gstasfdemux.c +++ b/gst/asfdemux/gstasfdemux.c @@ -1156,7 +1156,7 @@ gst_asf_demux_get_gst_tag_from_tag_name (const gchar * name_utf16le, "WM/Genre", GST_TAG_GENRE}, { "WM/AlbumTitle", GST_TAG_ALBUM}, { "WM/AlbumArtist", GST_TAG_ARTIST}, { - "WM/TrackNumber", GST_TAG_TRACK_NUMBER}, { + "WM/Track", GST_TAG_TRACK_NUMBER}, { "WM/Year", GST_TAG_DATE} /* { "WM/Composer", GST_TAG_COMPOSER } */ }; @@ -1173,15 +1173,15 @@ gst_asf_demux_get_gst_tag_from_tag_name (const gchar * name_utf16le, return NULL; } - GST_DEBUG ("map tagname '%s'", name_utf8); - for (i = 0; i < G_N_ELEMENTS (tags); ++i) { if (strncmp (tags[i].asf_name, name_utf8, out) == 0) { + GST_LOG ("map tagname '%s' -> '%s'", name_utf8, tags[i].gst_name); g_free (name_utf8); return tags[i].gst_name; } } + GST_LOG ("unhandled tagname '%s'", name_utf8); g_free (name_utf8); return NULL; } @@ -1227,10 +1227,10 @@ gst_asf_demux_process_ext_content_desc (GstASFDemux * demux, guint8 ** p_data, * WM/ProviderRating = 8 * WM/ProviderStyle = Rock (similar to WM/Genre) * WM/GenreID (similar to WM/Genre) + * WM/TrackNumber (same as WM/Track but as a string) * * Other known (and unused) 'non-text' metadata available : * - * WM/Track (same as WM/TrackNumber but starts at 0) * WM/EncodingTime * WM/MCDI * IsVBR @@ -1275,7 +1275,7 @@ gst_asf_demux_process_ext_content_desc (GstASFDemux * demux, guint8 ** p_data, goto not_enough_data; gst_tag_name = gst_asf_demux_get_gst_tag_from_tag_name (name, name_len); - if (datatype && (gst_tag_name != NULL)) { + if (gst_tag_name != NULL) { switch (datatype) { case ASF_DEMUX_DATA_TYPE_UTF16LE_STRING:{ gchar *value_utf8; @@ -1310,8 +1310,9 @@ gst_asf_demux_process_ext_content_desc (GstASFDemux * demux, guint8 ** p_data, break; } case ASF_DEMUX_DATA_TYPE_DWORD:{ - g_value_init (&tag_value, G_TYPE_INT); - g_value_set_int (&tag_value, (gint) GST_READ_UINT32_LE (value)); + /* this is the track number */ + g_value_init (&tag_value, G_TYPE_UINT); + g_value_set_uint (&tag_value, (guint) GST_READ_UINT32_LE (value)); break; } default:{