diff options
author | Mark Nauwelaerts <mnauw@users.sourceforge.net> | 2015-02-22 10:01:33 +0100 |
---|---|---|
committer | Mark Nauwelaerts <mnauw@users.sourceforge.net> | 2015-02-23 20:08:20 +0100 |
commit | aca7faf52036d1d99f2a55bf3b2a7ed89184fe1d (patch) | |
tree | f9d75261a00f5ec7946360f472ef58eb53946f8f | |
parent | 84f0410186c4bd7ae432a23096b37c5bf595e992 (diff) |
baseparse: drain segment upon SEGMENT_DONE to ensure proper event order
-rw-r--r-- | libs/gst/base/gstbaseparse.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libs/gst/base/gstbaseparse.c b/libs/gst/base/gstbaseparse.c index 32b80cff8..9605e3850 100644 --- a/libs/gst/base/gstbaseparse.c +++ b/libs/gst/base/gstbaseparse.c @@ -1135,6 +1135,17 @@ gst_base_parse_sink_event_default (GstBaseParse * parse, GstEvent * event) break; } + case GST_EVENT_SEGMENT_DONE: + /* need to drain now, rather than upon a new segment, + * since that would have SEGMENT_DONE come before potential + * delayed last part of the current segment */ + GST_DEBUG_OBJECT (parse, "draining current segment"); + if (parse->segment.rate > 0.0) + gst_base_parse_drain (parse); + else + gst_base_parse_finish_fragment (parse, FALSE); + break; + case GST_EVENT_FLUSH_START: GST_OBJECT_LOCK (parse); parse->priv->flushing = TRUE; |