taglist, plugins: fix compiler warnings with GLib >= 2.76
[platform/upstream/gstreamer.git] / subprojects / gst-plugins-base / gst / subparse / gstsubparse.c
index 8ce616d..1867dee 100644 (file)
@@ -185,6 +185,7 @@ gst_sub_parse_init (GstSubParse * subparse)
   subparse->strip_pango_markup = FALSE;
   subparse->flushing = FALSE;
   gst_segment_init (&subparse->segment, GST_FORMAT_TIME);
+  subparse->segment_seqnum = gst_util_seqnum_next ();
   subparse->need_segment = TRUE;
   subparse->encoding = g_strdup (DEFAULT_ENCODING);
   subparse->detected_encoding = NULL;
@@ -609,8 +610,7 @@ parse_mdvdsub (ParserState * state, const gchar * line)
       break;
     }
   }
-  ret = markup->str;
-  g_string_free (markup, FALSE);
+  ret = g_string_free (markup, FALSE);
   GST_DEBUG ("parse_mdvdsub returning (%f+%f): %s",
       state->start_time / (double) GST_SECOND,
       state->duration / (double) GST_SECOND, ret);
@@ -778,7 +778,7 @@ subrip_fix_up_markup (gchar ** p_txt, gconstpointer allowed_tags_ptr)
     }
 
     if (*next_tag == '<' && *(next_tag + 1) == '/') {
-      end_tag = strchr (cur, '>');
+      end_tag = strchr (next_tag, '>');
       if (end_tag) {
         const gchar *last = NULL;
         if (num_open_tags > 0)
@@ -793,6 +793,8 @@ subrip_fix_up_markup (gchar ** p_txt, gconstpointer allowed_tags_ptr)
         } else {
           --num_open_tags;
           g_ptr_array_remove_index (open_tags, num_open_tags);
+          cur = end_tag + 1;
+          continue;
         }
       }
     }
@@ -1625,10 +1627,12 @@ check_initial_events (GstSubParse * self)
 
   /* Push newsegment if needed */
   if (self->need_segment) {
+    GstEvent *segment_event = gst_event_new_segment (&self->segment);
     GST_LOG_OBJECT (self, "pushing newsegment event with %" GST_SEGMENT_FORMAT,
         &self->segment);
 
-    gst_pad_push_event (self->srcpad, gst_event_new_segment (&self->segment));
+    gst_event_set_seqnum (segment_event, self->segment_seqnum);
+    gst_pad_push_event (self->srcpad, segment_event);
     self->need_segment = FALSE;
   }
 
@@ -1805,6 +1809,7 @@ gst_sub_parse_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
         gst_event_copy_segment (event, &self->segment);
       GST_DEBUG_OBJECT (self, "newsegment (%s)",
           gst_format_get_name (self->segment.format));
+      self->segment_seqnum = gst_event_get_seqnum (event);
 
       /* if not time format, we'll either start with a 0 timestamp anyway or
        * it's following a seek in which case we'll have saved the requested