Index: gst/subparse/samiparse.c
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-base/gst/subparse/samiparse.c,v
retrieving revision 1.12
diff -u -p -r1.12 samiparse.c
--- gst/subparse/samiparse.c	3 Sep 2008 10:12:03 -0000	1.12
+++ gst/subparse/samiparse.c	11 Dec 2008 15:21:50 -0000
@@ -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 *
   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 xml
 {
   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 xmlCh
 {
   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) {
@@ -442,6 +449,8 @@ parse_sami (ParserState * state, const g
   gchar *fixed_line;
   GstSamiContext *context = (GstSamiContext *) state->user_data;
 
+  GST_WARNING("Parsing line %s", line);
+
   fixed_line = fix_invalid_entities (line);
   htmlParseChunk (context->htmlctxt, fixed_line, strlen (fixed_line), 0);
   g_free (fixed_line);
