[0.11] gst-plugins-good: matroskademux: tweak final closing segment sending

Sebastian Dröge slomo at kemper.freedesktop.org
Tue Jan 10 05:33:06 PST 2012


Module: gst-plugins-good
Branch: 0.11
Commit: fd880965773834e167841f54166e8c5e761c1e5b
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-good/commit/?id=fd880965773834e167841f54166e8c5e761c1e5b

Author: Mark Nauwelaerts <mark.nauwelaerts at collabora.co.uk>
Date:   Tue Dec 13 17:02:01 2011 +0100

matroskademux: tweak final closing segment sending

... to avoid it interfering with (sparse) stream syncing.

---

 gst/matroska/matroska-demux.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/gst/matroska/matroska-demux.c b/gst/matroska/matroska-demux.c
index 8247d76..00162e2 100644
--- a/gst/matroska/matroska-demux.c
+++ b/gst/matroska/matroska-demux.c
@@ -4432,13 +4432,17 @@ pause:
       /* Close the segment, i.e. update segment stop with the duration
        * if no stop was set */
       if (GST_CLOCK_TIME_IS_VALID (demux->last_stop_end) &&
-          !GST_CLOCK_TIME_IS_VALID (demux->common.segment.stop)) {
+          !GST_CLOCK_TIME_IS_VALID (demux->common.segment.stop) &&
+          GST_CLOCK_TIME_IS_VALID (demux->common.segment.start) &&
+          demux->last_stop_end > demux->common.segment.start) {
+        /* arrange to accumulate duration downstream, but avoid sending
+         * newsegment with decreasing start (w.r.t. sync newsegment events) */
         GstEvent *event =
             gst_event_new_new_segment_full (TRUE, demux->common.segment.rate,
             demux->common.segment.applied_rate, demux->common.segment.format,
-            demux->common.segment.start,
-            MAX (demux->last_stop_end, demux->common.segment.start),
-            demux->common.segment.time);
+            demux->last_stop_end, demux->last_stop_end,
+            demux->common.segment.time + (demux->last_stop_end -
+                demux->common.segment.start));
         gst_matroska_demux_send_event (demux, event);
       }
 



More information about the gstreamer-commits mailing list