mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 19:51:11 +00:00
gst/subparse/samiparse.c: Some versions of libxml seem to be very picky as to strict formatting of the input and neve...
Original commit message from CVS: * 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
This commit is contained in:
parent
d477a37e7e
commit
7a83664099
2 changed files with 18 additions and 1 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
|||
2008-12-11 Edward Hervey <edward.hervey@collabora.co.uk>
|
||||
|
||||
* 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 <sebastian.droege@collabora.co.uk>
|
||||
|
||||
Patch by: Guillaume Emont <guillaume at fluendo dot com>
|
||||
|
|
|
@ -60,6 +60,7 @@ has_tag (GString * str, const gchar tag)
|
|||
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 @@ sami_context_pop_state (GstSamiContext * sctx, char state)
|
|||
GString *context_state = sctx->state;
|
||||
int i;
|
||||
|
||||
GST_LOG ("state %c", state);
|
||||
for (i = context_state->len - 1; i >= 0; i--) {
|
||||
switch (context_state->str[i]) {
|
||||
case ITALIC_TAG: /* <i> */
|
||||
|
@ -211,6 +213,8 @@ start_sami_element (void *ctx, const xmlChar * name, const xmlChar ** atts)
|
|||
{
|
||||
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 @@ end_sami_element (void *ctx, const xmlChar * name)
|
|||
{
|
||||
GstSamiContext *sctx = (GstSamiContext *) ctx;
|
||||
|
||||
GST_LOG ("name:%s", name);
|
||||
|
||||
if (!xmlStrncmp ((const xmlChar *) "sync", name, 4)) {
|
||||
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) {
|
||||
|
|
Loading…
Reference in a new issue