baseparse: push pending events before GAP event
authorThiago Santos <ts.santos@sisa.samsung.com>
Thu, 2 Jan 2014 16:43:54 +0000 (13:43 -0300)
committerThiago Santos <ts.santos@sisa.samsung.com>
Thu, 2 Jan 2014 19:38:40 +0000 (16:38 -0300)
A GAP event is handled as an empty buffer by sinks and they expect
to receive start up events before GAP events (like a segment).

This is important specially if there is a GAP at the beginning of
a stream (before any buffers) so that the segment event can be
pushed downstream before the GAP

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

libs/gst/base/gstbaseparse.c

index b0ca623..627bfd0 100644 (file)
@@ -1186,6 +1186,9 @@ gst_base_parse_sink_event_default (GstBaseParse * parse, GstEvent * event)
     case GST_EVENT_GAP:
     {
       GST_DEBUG_OBJECT (parse, "draining current data due to gap event");
+
+      gst_base_parse_push_pending_events (parse);
+
       if (parse->segment.rate > 0.0)
         gst_base_parse_drain (parse);
       else