summaryrefslogtreecommitdiffstats
path: root/ext/annodex/gstcmmldec.c
diff options
context:
space:
mode:
authorAlessandro Decina <alessandro@nnva.org>2006-09-04 09:34:25 +0000
committerWim Taymans <wim.taymans@gmail.com>2006-09-04 09:34:25 +0000
commitfc559fff48fc72e04aca551519d5bf8dfef8d877 (patch)
treea5754b29cbe5a14e3ccb0e5c9f296e48c13950ad /ext/annodex/gstcmmldec.c
parent7e97d570ae56158a8c6e24e4a38f640380fa6042 (diff)
ext/annodex/gstcmmldec.c: Seeking back in a file containing a CMML stream errors out if the seek goes back up to the ...
Original commit message from CVS: Patch by: Alessandro Decina <alessandro at nnva dot org> * ext/annodex/gstcmmldec.c: (gst_cmml_dec_chain): Seeking back in a file containing a CMML stream errors out if the seek goes back up to the CMML headers. This is because after the seek the xml processing instruction <?xml ...?> is submitted to the xml parser again, which results in an error. The attached patch fixes the problem. Fixes #353908. * ext/annodex/gstcmmlenc.h: Fix authors name.
Diffstat (limited to 'ext/annodex/gstcmmldec.c')
-rw-r--r--ext/annodex/gstcmmldec.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/ext/annodex/gstcmmldec.c b/ext/annodex/gstcmmldec.c
index b3884880..75038c61 100644
--- a/ext/annodex/gstcmmldec.c
+++ b/ext/annodex/gstcmmldec.c
@@ -391,10 +391,15 @@ gst_cmml_dec_chain (GstPad * pad, GstBuffer * buffer)
/* handle the packet. the handler will set dec->flow_return */
switch (packet) {
case GST_CMML_PACKET_IDENT_HEADER:
- gst_cmml_dec_parse_ident_header (dec, buffer);
+ if (dec->sent_root == FALSE)
+ /* don't parse the ident again in case of seeking to the beginning */
+ gst_cmml_dec_parse_ident_header (dec, buffer);
break;
case GST_CMML_PACKET_FIRST_HEADER:
- gst_cmml_dec_parse_first_header (dec, buffer);
+ if (dec->sent_root == FALSE)
+ /* don't parse the xml preamble if it has already been parsed because it
+ * would error out, so seeking to the beginning would fail */
+ gst_cmml_dec_parse_first_header (dec, buffer);
break;
case GST_CMML_PACKET_SECOND_HEADER:
case GST_CMML_PACKET_CLIP: