From: Vincent Penquerc'h Date: Tue, 1 Jul 2014 14:14:34 +0000 (+0100) Subject: matroskademux: send gap events instead of segment tricks X-Git-Tag: 1.3.91~20 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5653b1a25a4aa957b9351bcb14f319bf3a81a5e1;p=platform%2Fupstream%2Fgst-plugins-good.git matroskademux: send gap events instead of segment tricks This fixes missing frames from being time skipped. https://bugzilla.gnome.org/show_bug.cgi?id=732372 --- diff --git a/gst/matroska/matroska-demux.c b/gst/matroska/matroska-demux.c index 63ecfe1..adef916 100644 --- a/gst/matroska/matroska-demux.c +++ b/gst/matroska/matroska-demux.c @@ -3478,37 +3478,18 @@ gst_matroska_demux_parse_blockgroup_or_simpleblock (GstMatroskaDemux * demux, && lace_time > demux->common.segment.start && (!GST_CLOCK_TIME_IS_VALID (demux->common.segment.stop) || lace_time < demux->common.segment.stop)) { - GstSegment segment; - GstEvent *event1, *event2; + GstEvent *event; GST_DEBUG_OBJECT (demux, "Gap of %" G_GINT64_FORMAT " ns detected in" "stream %d (%" GST_TIME_FORMAT " -> %" GST_TIME_FORMAT "). " "Sending updated SEGMENT events", diff, stream->index, GST_TIME_ARGS (stream->pos), GST_TIME_ARGS (lace_time)); - /* send segment events such that the gap is not accounted in - * segment base time, hence running_time */ - /* close ahead of gap */ - segment = demux->common.segment; - segment.start = demux->last_stop_end; - segment.stop = demux->last_stop_end; - segment.position = demux->last_stop_end; - event1 = gst_event_new_segment (&segment); - /* skip gap */ - segment.start = lace_time; - segment.stop = demux->common.segment.stop; - segment.position = lace_time; - event2 = gst_event_new_segment (&segment); + + event = gst_event_new_gap (demux->last_stop_end, diff); GST_OBJECT_UNLOCK (demux); - gst_matroska_demux_send_event (demux, event1); - gst_matroska_demux_send_event (demux, event2); + gst_pad_push_event (stream->pad, event); GST_OBJECT_LOCK (demux); - /* align segment view with downstream, - * prevents double-counting base time when closing segment */ - /* FIXME: in 0.10, the segment base/accum got updated here, but - * maybe we don't need that because of the double accounting - * mentioned above? */ - demux->common.segment = segment; } }