mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 09:10:36 +00:00
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.
This commit is contained in:
parent
f670909edb
commit
c6b9d19c31
3 changed files with 19 additions and 6 deletions
11
ChangeLog
11
ChangeLog
|
@ -1,3 +1,14 @@
|
||||||
|
2006-01-06 Edward Hervey <edward@fluendo.com>
|
||||||
|
|
||||||
|
* 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.
|
||||||
|
|
||||||
2006-01-05 Stefan Kost <ensonic@users.sf.net>
|
2006-01-05 Stefan Kost <ensonic@users.sf.net>
|
||||||
|
|
||||||
* gst/videobox/gstvideobox.c: (gst_video_box_class_init),
|
* gst/videobox/gstvideobox.c: (gst_video_box_class_init),
|
||||||
|
|
|
@ -280,7 +280,9 @@ gst_id3demux_add_srcpad (GstID3Demux * id3demux, GstCaps * new_caps)
|
||||||
id3demux->src_caps);
|
id3demux->src_caps);
|
||||||
|
|
||||||
gst_object_ref (id3demux->srcpad);
|
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;
|
return TRUE;
|
||||||
|
|
|
@ -161,12 +161,12 @@ parse_comment_frame (ID3TagsWorking * work)
|
||||||
parse_split_strings (work, encoding, &description, &text);
|
parse_split_strings (work, encoding, &description, &text);
|
||||||
|
|
||||||
if (text == NULL || description == NULL) {
|
if (text == NULL || description == NULL) {
|
||||||
GST_ERROR ("Failed to decode comment frame");
|
GST_WARNING ("Failed to decode comment frame");
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!g_utf8_validate (text, -1, NULL)) {
|
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;
|
goto fail;
|
||||||
} else {
|
} else {
|
||||||
if (strlen (description) > 0 && g_utf8_validate (description, -1, NULL)) {
|
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)) {
|
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);
|
g_free (text);
|
||||||
text = NULL;
|
text = NULL;
|
||||||
}
|
}
|
||||||
|
@ -332,7 +332,7 @@ parse_split_strings (ID3TagsWorking * work, guint8 encoding,
|
||||||
|
|
||||||
switch (encoding) {
|
switch (encoding) {
|
||||||
case ID3V2_ENCODING_ISO8859:
|
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) {
|
if (work->parse_data[text_pos] == 0) {
|
||||||
*field1 = g_convert ((gchar *) (work->parse_data + 4),
|
*field1 = g_convert ((gchar *) (work->parse_data + 4),
|
||||||
text_pos - 4, "UTF-8", "ISO-8859-1", NULL, NULL, NULL);
|
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:
|
case ID3V2_ENCODING_UTF16BE:
|
||||||
{
|
{
|
||||||
/* Find '\0\0' terminator */
|
/* 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 &&
|
if (work->parse_data[text_pos] == 0 &&
|
||||||
work->parse_data[text_pos + 1] == 0) {
|
work->parse_data[text_pos + 1] == 0) {
|
||||||
/* found our delimiter */
|
/* found our delimiter */
|
||||||
|
|
Loading…
Reference in a new issue