bilboed gst-plugins-base: gst-plugins-base/ gst-plugins-base/gst/subparse/

[email protected] Thu, 11 Dec 2008 07:49:27 -0800 (PST)
Newsgroups gmane.comp.video.gstreamer.cvs
Message-ID <[email protected]>
CVS Root:       /cvs/gstreamer
Module:         gst-plugins-base
Changes by:     bilboed
Date:           Thu Dec 11 2008  15:49:26 UTC

Log message:
* gst/subparse/samiparse.c: (sami_context_push_state),
(sami_context_pop_state), (start_sami_element), (end_sami_element):
Some versions of libxml seem to be very picky as to strict formatting
of the input and never 'close' the final </body> tag.
In order to fix that bad behaviour, we trigger the flushing of
remaining data on both </body> and </sami>.
Fixes #557365

Modified files:
    .               : ChangeLog
    gst/subparse    : samiparse.c

Links:
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-base/ChangeLog.diff?r1=1.4245&r2=1.4246
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-base/gst/subparse/samiparse.c.diff?r1=1.12&r2=1.13

====Begin Diffs====
Index: ChangeLog
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-base/ChangeLog,v
retrieving revision 1.4245
retrieving revision 1.4246
diff -u -d -r1.4245 -r1.4246
--- ChangeLog	11 Dec 2008 12:32:01 -0000	1.4245
+++ ChangeLog	11 Dec 2008 15:49:11 -0000	1.4246
@@ -1,3 +1,13 @@
+2008-12-11  Edward Hervey  <[email protected]>
+
+	* gst/subparse/samiparse.c: (sami_context_push_state),
+	(sami_context_pop_state), (start_sami_element), (end_sami_element):
+	Some versions of libxml seem to be very picky as to strict formatting
+	of the input and never 'close' the final </body> tag.
+	In order to fix that bad behaviour, we trigger the flushing of
+	remaining data on both </body> and </sami>.
+	Fixes #557365
 2008-12-11  Sebastian Dröge  <[email protected]>
 
 	Patch by: Guillaume Emont <guillaume at fluendo dot com>
Index: samiparse.c
RCS file: /cvs/gstreamer/gst-plugins-base/gst/subparse/samiparse.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- samiparse.c	3 Sep 2008 10:12:03 -0000	1.12
+++ samiparse.c	11 Dec 2008 15:49:12 -0000	1.13
@@ -60,6 +60,7 @@
 static void
 sami_context_push_state (GstSamiContext * sctx, char state)
 {
+  GST_LOG ("state %c", state);
   g_string_append_c (sctx->state, state);
 }
@@ -70,6 +71,7 @@
   GString *context_state = sctx->state;
   int i;
   for (i = context_state->len - 1; i >= 0; i--) {
     switch (context_state->str[i]) {
       case ITALIC_TAG:         /* <i> */
@@ -211,6 +213,8 @@
   GstSamiContext *sctx = (GstSamiContext *) ctx;
+  GST_LOG ("name:%s", name);
   if (!xmlStrncmp ((const xmlChar *) "sync", name, 4)) {
     handle_start_sync (sctx, atts);
     sctx->in_sync = TRUE;
@@ -239,9 +243,12 @@
     sctx->in_sync = FALSE;
-  } else if (!xmlStrncmp ((const xmlChar *) "body", name, 4)) {
+  } else if ((!xmlStrncmp ((const xmlChar *) "body", name, 4)) ||
+      (!xmlStrncmp ((const xmlChar *) "sami", name, 4))) {
     /* We will usually have one buffer left when the body is closed
      * as we need the next sync to actually send it */
     if (sctx->buf->len != 0) {

------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/

_______________________________________________
gstreamer-cvs-verbose mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gstreamer-cvs-verbose