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).
This commit is contained in:
Stefan Kost 2006-09-07 16:05:31 +00:00
parent e70a50e330
commit f960e4ca4d
2 changed files with 18 additions and 7 deletions

View file

@ -1,3 +1,13 @@
2006-09-07 Stefan Kost <ensonic@users.sf.net>
* 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 <ensonic@users.sf.net> 2006-09-07 Stefan Kost <ensonic@users.sf.net>
* gst/asfdemux/gstasfdemux.c: * gst/asfdemux/gstasfdemux.c:

View file

@ -1156,7 +1156,7 @@ gst_asf_demux_get_gst_tag_from_tag_name (const gchar * name_utf16le,
"WM/Genre", GST_TAG_GENRE}, { "WM/Genre", GST_TAG_GENRE}, {
"WM/AlbumTitle", GST_TAG_ALBUM}, { "WM/AlbumTitle", GST_TAG_ALBUM}, {
"WM/AlbumArtist", GST_TAG_ARTIST}, { "WM/AlbumArtist", GST_TAG_ARTIST}, {
"WM/TrackNumber", GST_TAG_TRACK_NUMBER}, { "WM/Track", GST_TAG_TRACK_NUMBER}, {
"WM/Year", GST_TAG_DATE} "WM/Year", GST_TAG_DATE}
/* { "WM/Composer", GST_TAG_COMPOSER } */ /* { "WM/Composer", GST_TAG_COMPOSER } */
}; };
@ -1173,15 +1173,15 @@ gst_asf_demux_get_gst_tag_from_tag_name (const gchar * name_utf16le,
return NULL; return NULL;
} }
GST_DEBUG ("map tagname '%s'", name_utf8);
for (i = 0; i < G_N_ELEMENTS (tags); ++i) { for (i = 0; i < G_N_ELEMENTS (tags); ++i) {
if (strncmp (tags[i].asf_name, name_utf8, out) == 0) { 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); g_free (name_utf8);
return tags[i].gst_name; return tags[i].gst_name;
} }
} }
GST_LOG ("unhandled tagname '%s'", name_utf8);
g_free (name_utf8); g_free (name_utf8);
return NULL; return NULL;
} }
@ -1227,10 +1227,10 @@ gst_asf_demux_process_ext_content_desc (GstASFDemux * demux, guint8 ** p_data,
* WM/ProviderRating = 8 * WM/ProviderRating = 8
* WM/ProviderStyle = Rock (similar to WM/Genre) * WM/ProviderStyle = Rock (similar to WM/Genre)
* WM/GenreID (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 : * Other known (and unused) 'non-text' metadata available :
* *
* WM/Track (same as WM/TrackNumber but starts at 0)
* WM/EncodingTime * WM/EncodingTime
* WM/MCDI * WM/MCDI
* IsVBR * IsVBR
@ -1275,7 +1275,7 @@ gst_asf_demux_process_ext_content_desc (GstASFDemux * demux, guint8 ** p_data,
goto not_enough_data; goto not_enough_data;
gst_tag_name = gst_asf_demux_get_gst_tag_from_tag_name (name, name_len); 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) { switch (datatype) {
case ASF_DEMUX_DATA_TYPE_UTF16LE_STRING:{ case ASF_DEMUX_DATA_TYPE_UTF16LE_STRING:{
gchar *value_utf8; gchar *value_utf8;
@ -1310,8 +1310,9 @@ gst_asf_demux_process_ext_content_desc (GstASFDemux * demux, guint8 ** p_data,
break; break;
} }
case ASF_DEMUX_DATA_TYPE_DWORD:{ case ASF_DEMUX_DATA_TYPE_DWORD:{
g_value_init (&tag_value, G_TYPE_INT); /* this is the track number */
g_value_set_int (&tag_value, (gint) GST_READ_UINT32_LE (value)); g_value_init (&tag_value, G_TYPE_UINT);
g_value_set_uint (&tag_value, (guint) GST_READ_UINT32_LE (value));
break; break;
} }
default:{ default:{