summaryrefslogtreecommitdiffstats
path: root/ext/annodex
diff options
context:
space:
mode:
authorJan Schmidt <thaytan@mad.scientist.com>2006-02-28 09:21:27 +0000
committerJan Schmidt <thaytan@mad.scientist.com>2006-02-28 09:21:27 +0000
commit86ddc6d513b81b6fca8896151a87a06560261f75 (patch)
treefd849a9338dc3137704054dac1f503106a980a97 /ext/annodex
parent4d83c2400a21468b59d85337c353de02965cf924 (diff)
ext/annodex/: Add a little extra debug. Make the decoder not return NOT_LINKED, as we want to continue decoding all C...
Original commit message from CVS: * ext/annodex/gstcmmldec.c: (gst_cmml_dec_sink_event), (gst_cmml_dec_new_buffer), (gst_cmml_dec_parse_preamble), (gst_cmml_dec_parse_head), (gst_cmml_dec_push_clip): * ext/annodex/gstcmmlparser.c: (gst_cmml_parser_parse_chunk): Add a little extra debug. Make the decoder not return NOT_LINKED, as we want to continue decoding all CMML and emitting tags.
Diffstat (limited to 'ext/annodex')
-rw-r--r--ext/annodex/gstcmmldec.c17
-rw-r--r--ext/annodex/gstcmmlparser.c4
2 files changed, 15 insertions, 6 deletions
diff --git a/ext/annodex/gstcmmldec.c b/ext/annodex/gstcmmldec.c
index a2bb67b3..26376f47 100644
--- a/ext/annodex/gstcmmldec.c
+++ b/ext/annodex/gstcmmldec.c
@@ -357,6 +357,8 @@ gst_cmml_dec_sink_event (GstPad * pad, GstEvent * event)
if (dec->flow_return == GST_FLOW_OK)
dec->flow_return = gst_pad_push (dec->srcpad, buffer);
+ if (dec->flow_return == GST_FLOW_NOT_LINKED)
+ dec->flow_return = GST_FLOW_OK; /* Ignore NOT_LINKED */
break;
}
@@ -449,6 +451,8 @@ gst_cmml_dec_new_buffer (GstCmmlDec * dec,
if (data)
memcpy (GST_BUFFER_DATA (*buffer), data, size);
GST_BUFFER_TIMESTAMP (*buffer) = dec->timestamp;
+ } else if (res == GST_FLOW_NOT_LINKED) {
+ GST_DEBUG_OBJECT (dec, "alloc function return NOT-LINKED, ignoring");
} else {
GST_WARNING_OBJECT (dec, "alloc function returned error %s",
gst_flow_get_name (res));
@@ -547,15 +551,16 @@ gst_cmml_dec_parse_preamble (GstCmmlDec * dec, guchar * preamble,
/* push the root element */
dec->flow_return = gst_cmml_dec_new_buffer (dec,
encoded_preamble, strlen ((gchar *) encoded_preamble), &buffer);
- if (dec->flow_return != GST_FLOW_OK)
- goto done;
+ if (dec->flow_return == GST_FLOW_OK) {
+ dec->flow_return = gst_pad_push (dec->srcpad, buffer);
+ }
- dec->flow_return = gst_pad_push (dec->srcpad, buffer);
+ if (dec->flow_return == GST_FLOW_NOT_LINKED)
+ dec->flow_return = GST_FLOW_OK; /* Ignore NOT_LINKED */
if (!GST_FLOW_IS_FATAL (dec->flow_return)) {
GST_INFO_OBJECT (dec, "preamble parsed");
}
-done:
g_free (encoded_preamble);
return;
}
@@ -598,6 +603,8 @@ gst_cmml_dec_parse_head (GstCmmlDec * dec, GstCmmlTagHead * head)
g_free (head_str);
if (dec->flow_return == GST_FLOW_OK)
dec->flow_return = gst_pad_push (dec->srcpad, buffer);
+ if (dec->flow_return == GST_FLOW_NOT_LINKED)
+ dec->flow_return = GST_FLOW_OK; /* Ignore NOT_LINKED */
}
/* send a TAG_MESSAGE event for a clip */
@@ -627,6 +634,8 @@ gst_cmml_dec_push_clip (GstCmmlDec * dec, GstCmmlTagClip * clip)
clip_str, strlen ((gchar *) clip_str), &buffer);
if (dec->flow_return == GST_FLOW_OK)
dec->flow_return = gst_pad_push (dec->srcpad, buffer);
+ if (dec->flow_return == GST_FLOW_NOT_LINKED)
+ dec->flow_return = GST_FLOW_OK; /* Ignore NOT_LINKED */
g_free (clip_str);
}
diff --git a/ext/annodex/gstcmmlparser.c b/ext/annodex/gstcmmlparser.c
index 1411478a..3992daf2 100644
--- a/ext/annodex/gstcmmlparser.c
+++ b/ext/annodex/gstcmmlparser.c
@@ -72,8 +72,7 @@ gst_cmml_parser_new (GstCmmlParserMode mode)
(startElementNsSAX2Func) gst_cmml_parser_parse_start_element_ns;
parser->context->sax->endElementNs =
(endElementNsSAX2Func) gst_cmml_parser_parse_end_element_ns;
- parser->context->sax->processingInstruction =
- (processingInstructionSAXFunc)
+ parser->context->sax->processingInstruction = (processingInstructionSAXFunc)
gst_cmml_parser_parse_processing_instruction;
parser->preamble_callback = NULL;
parser->cmml_end_callback = NULL;
@@ -111,6 +110,7 @@ gst_cmml_parser_parse_chunk (GstCmmlParser * parser,
if (xmlres != XML_ERR_OK) {
xmlErrorPtr xml_error = xmlCtxtGetLastError (parser->context);
+ GST_DEBUG ("Error occurred decoding chunk %s", data);
g_set_error (err,
GST_LIBRARY_ERROR, GST_LIBRARY_ERROR_FAILED, xml_error->message);
return FALSE;