Commit 1d6e1c99 authored by Jan Schmidt's avatar Jan Schmidt
Browse files

gst/id3demux/id3v2frames.c: Never output a tag with a null contents string.

Original commit message from CVS:
* gst/id3demux/id3v2frames.c: (parse_text_identification_frame),
(id3v2_tag_to_taglist), (id3v2_genre_string_to_taglist),
(id3v2_genre_fields_to_taglist):
Never output a tag with a null contents string.
parent 9a64d2bb
2006-02-03 Jan Schmidt <thaytan@mad.scientist.com>
* gst/id3demux/id3v2frames.c: (parse_text_identification_frame),
(id3v2_tag_to_taglist), (id3v2_genre_string_to_taglist),
(id3v2_genre_fields_to_taglist):
Never output a tag with a null contents string.
2006-02-02 Tim-Philipp Müller <tim at centricular dot net> 2006-02-02 Tim-Philipp Müller <tim at centricular dot net>
* gst/avi/gstavidemux.c: (gst_avi_demux_all_source_pads_unlinked): * gst/avi/gstavidemux.c: (gst_avi_demux_all_source_pads_unlinked):
......
...@@ -232,6 +232,16 @@ parse_text_identification_frame (ID3TagsWorking * work) ...@@ -232,6 +232,16 @@ parse_text_identification_frame (ID3TagsWorking * work)
encoding = work->parse_data[0]; encoding = work->parse_data[0];
parse_split_strings (encoding, (gchar *) work->parse_data + 1, parse_split_strings (encoding, (gchar *) work->parse_data + 1,
work->parse_size - 1, &fields); work->parse_size - 1, &fields);
if (fields) {
if (fields->len > 0) {
GST_LOG ("Read %d fields from Text ID frame of size %d. First is '%s'",
fields->len, work->parse_size - 1,
g_array_index (fields, gchar *, 0));
} else {
GST_LOG ("Read %d fields from Text ID frame of size %d", fields->len,
work->parse_size - 1);
}
}
return fields; return fields;
} }
...@@ -243,6 +253,9 @@ id3v2_tag_to_taglist (ID3TagsWorking * work, const gchar * tag_name, ...@@ -243,6 +253,9 @@ id3v2_tag_to_taglist (ID3TagsWorking * work, const gchar * tag_name,
GType tag_type = gst_tag_get_type (tag_name); GType tag_type = gst_tag_get_type (tag_name);
GstTagList *tag_list = work->tags; GstTagList *tag_list = work->tags;
if (tag_str == NULL)
return FALSE;
switch (tag_type) { switch (tag_type) {
case G_TYPE_UINT: case G_TYPE_UINT:
{ {
...@@ -371,8 +384,7 @@ id3v2_genre_string_to_taglist (ID3TagsWorking * work, const gchar * tag_name, ...@@ -371,8 +384,7 @@ id3v2_genre_string_to_taglist (ID3TagsWorking * work, const gchar * tag_name,
/* If it's a number, it might be a defined genre */ /* If it's a number, it might be a defined genre */
if (id3v2_are_digits (tag_str, len)) { if (id3v2_are_digits (tag_str, len)) {
tag_str = gst_tag_id3_genre_get (strtol (tag_str, NULL, 10)); tag_str = gst_tag_id3_genre_get (strtol (tag_str, NULL, 10));
if (tag_str != NULL) return id3v2_tag_to_taglist (work, tag_name, tag_str);
return id3v2_tag_to_taglist (work, tag_name, tag_str);
} }
/* Otherwise it might be "RX" or "CR" */ /* Otherwise it might be "RX" or "CR" */
if (len == 2) { if (len == 2) {
...@@ -434,7 +446,7 @@ id3v2_genre_fields_to_taglist (ID3TagsWorking * work, const gchar * tag_name, ...@@ -434,7 +446,7 @@ id3v2_genre_fields_to_taglist (ID3TagsWorking * work, const gchar * tag_name,
} }
} }
if (len > 0) if (len > 0 && tag_str != NULL)
result |= id3v2_genre_string_to_taglist (work, tag_name, tag_str, len); result |= id3v2_genre_string_to_taglist (work, tag_name, tag_str, len);
} }
return result; return result;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment