summaryrefslogtreecommitdiffstats
path: root/gst/id3demux
diff options
context:
space:
mode:
authorEdward Hervey <bilboed@bilboed.com>2006-01-06 11:46:53 +0000
committerEdward Hervey <bilboed@bilboed.com>2006-01-06 11:46:53 +0000
commitc6b9d19c3100c3600243526986f9adb205bc55e1 (patch)
tree0ab941f4a20940f17fd3aa0b426218d4df5dc8df /gst/id3demux
parentf670909edbd4a95cfed93b4db85cb5ba93a17461 (diff)
gst/id3demux/gstid3demux.c: Add gst_element_no_more_pads() for proper decodebin behaviour.
Original commit message from CVS: * gst/id3demux/gstid3demux.c: (gst_id3demux_add_srcpad): Add gst_element_no_more_pads() for proper decodebin behaviour. * gst/id3demux/id3v2frames.c: (parse_comment_frame), (parse_text_identification_frame), (parse_split_strings): Failure to decode some tags is not a GST_ERROR() but a GST_WARNING() When iterating over a chunk of text, check that we haven't gone too far.
Diffstat (limited to 'gst/id3demux')
-rw-r--r--gst/id3demux/gstid3demux.c4
-rw-r--r--gst/id3demux/id3v2frames.c10
2 files changed, 8 insertions, 6 deletions
diff --git a/gst/id3demux/gstid3demux.c b/gst/id3demux/gstid3demux.c
index 541e1091..4f24b226 100644
--- a/gst/id3demux/gstid3demux.c
+++ b/gst/id3demux/gstid3demux.c
@@ -280,7 +280,9 @@ gst_id3demux_add_srcpad (GstID3Demux * id3demux, GstCaps * new_caps)
id3demux->src_caps);
gst_object_ref (id3demux->srcpad);
- return gst_element_add_pad (GST_ELEMENT (id3demux), id3demux->srcpad);
+ if (!(gst_element_add_pad (GST_ELEMENT (id3demux), id3demux->srcpad)))
+ return FALSE;
+ gst_element_no_more_pads (GST_ELEMENT (id3demux));
}
return TRUE;
diff --git a/gst/id3demux/id3v2frames.c b/gst/id3demux/id3v2frames.c
index fec70123..7b3b9bcf 100644
--- a/gst/id3demux/id3v2frames.c
+++ b/gst/id3demux/id3v2frames.c
@@ -161,12 +161,12 @@ parse_comment_frame (ID3TagsWorking * work)
parse_split_strings (work, encoding, &description, &text);
if (text == NULL || description == NULL) {
- GST_ERROR ("Failed to decode comment frame");
+ GST_WARNING ("Failed to decode comment frame");
goto fail;
}
if (!g_utf8_validate (text, -1, NULL)) {
- GST_ERROR ("Converted string is not valid utf-8");
+ GST_WARNING ("Converted string is not valid utf-8");
goto fail;
} else {
if (strlen (description) > 0 && g_utf8_validate (description, -1, NULL)) {
@@ -214,7 +214,7 @@ parse_text_identification_frame (ID3TagsWorking * work)
}
if (text != NULL && !g_utf8_validate (text, -1, NULL)) {
- GST_ERROR ("Converted string is not valid utf-8");
+ GST_WARNING ("Converted string is not valid utf-8");
g_free (text);
text = NULL;
}
@@ -332,7 +332,7 @@ parse_split_strings (ID3TagsWorking * work, guint8 encoding,
switch (encoding) {
case ID3V2_ENCODING_ISO8859:
- for (text_pos = 4; text_pos < work->parse_size - 1; text_pos++) {
+ for (text_pos = 4; text_pos < work->parse_size - 5; text_pos++) {
if (work->parse_data[text_pos] == 0) {
*field1 = g_convert ((gchar *) (work->parse_data + 4),
text_pos - 4, "UTF-8", "ISO-8859-1", NULL, NULL, NULL);
@@ -356,7 +356,7 @@ parse_split_strings (ID3TagsWorking * work, guint8 encoding,
case ID3V2_ENCODING_UTF16BE:
{
/* Find '\0\0' terminator */
- for (text_pos = 4; text_pos < work->parse_size - 2; text_pos++) {
+ for (text_pos = 4; text_pos < work->parse_size - 6; text_pos++) {
if (work->parse_data[text_pos] == 0 &&
work->parse_data[text_pos + 1] == 0) {
/* found our delimiter */