Message info
 
To:gstreamer-commits@lists.freedesktop.org From:Thibault Saunier Subject:gst-plugins-bad: tsdemux: set correct newsegment fields on _TIME seeks Date:Thu, 5 Apr 2012 14:15:50 -0700 (PDT)
 

Module: gst-plugins-bad
Branch: master
Commit: 877e6d6a367d079814ea71760c20e7e4867be37b
URL: http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=877e6d6a367d079814ea71760c20e7e4867be37b

Author: Alessandro Decina <alessandro.d@gmail.com>
Date: Thu Apr 5 06:18:28 2012 +0200

tsdemux: set correct newsegment fields on _TIME seeks

Forward the seek rate and set NS.start to the seek target so that decoders can
apply clipping where necessary.

---

gst/mpegtsdemux/tsdemux.c | 21 ++++++++++++++++++---
1 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/gst/mpegtsdemux/tsdemux.c b/gst/mpegtsdemux/tsdemux.c
index 8f4d78d..96eb75c 100644
--- a/gst/mpegtsdemux/tsdemux.c
+++ b/gst/mpegtsdemux/tsdemux.c
@@ -1449,11 +1449,26 @@ calculate_and_push_newsegment (GstTSDemux * demux, TSDemuxStream * stream)
}

if (!demux->segment_event) {
+ gint64 start, stop, time;
+
GST_DEBUG ("Calculating actual segment");
- /* FIXME : Set proper values */
+
+ if (demux->segment.format == GST_FORMAT_TIME) {
+ /* if we have a TIME segment, set NS.start to the target ts so downstream
+ * can clip
+ */
+ start = demux->segment.start;
+ stop = demux->segment.stop;
+ time = demux->segment.time;
+ } else {
+ /* ...else start from the first ts/pts */
+ start = firstts;
+ stop = GST_CLOCK_TIME_NONE;
+ time = firstts;
+ }
demux->segment_event =
- gst_event_new_new_segment_full (FALSE, 1.0, 1.0, GST_FORMAT_TIME,
- firstts, GST_CLOCK_TIME_NONE, firstts);
+ gst_event_new_new_segment_full (FALSE, demux->segment.rate,
+ demux->segment.applied_rate, GST_FORMAT_TIME, start, stop, time);
GST_EVENT_SRC (demux->segment_event) = gst_object_ref (demux);
}


_______________________________________________
gstreamer-commits mailing list
gstreamer-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/gstreamer-commits