matroskademux: make demuxer reusable
authorJonas Holmberg <jonashg@axis.com>
Thu, 25 Sep 2014 13:01:14 +0000 (15:01 +0200)
committerTim-Philipp Müller <tim@centricular.com>
Thu, 25 Sep 2014 15:14:18 +0000 (16:14 +0100)
Remove pads from flow combiner and reset last
flow return to FLOW_OK by resetting the flow combiner.
This prevents FLOW_FLUSHING when trying to re-use the
demuxer after setting it back to NULL/READY state.

https://bugzilla.gnome.org/show_bug.cgi?id=737359

gst/matroska/matroska-demux.c

index 571bda4..615d742 100644 (file)
@@ -265,9 +265,10 @@ gst_matroska_demux_init (GstMatroskaDemux * demux)
 
   GST_OBJECT_FLAG_SET (demux, GST_ELEMENT_FLAG_INDEXABLE);
 
+  demux->flowcombiner = gst_flow_combiner_new ();
+
   /* finish off */
   gst_matroska_demux_reset (GST_ELEMENT (demux));
-  demux->flowcombiner = gst_flow_combiner_new ();
 }
 
 static void
@@ -327,6 +328,8 @@ gst_matroska_demux_reset (GstElement * element)
   }
 
   demux->invalid_duration = FALSE;
+
+  gst_flow_combiner_clear (demux->flowcombiner);
 }
 
 static GstBuffer *