summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Santos <thiagoss@osg.samsung.com>2016-04-26 16:54:30 -0300
committerThiago Santos <thiago@waltznetworks.com>2018-05-14 16:08:55 -0700
commit96a56b82e641aced6fbaea893066f87fc3a29bbf (patch)
tree712520861448d75cd1831ad16d1a613e9453600c
parentd8b485f1d987f89153b563e9e19ebb657e4ed111 (diff)
qtdemux: offset edts segments by the min timestamp of the stream
Otherwise if the stream is starting at timestamp=X it would wait 'X' to start playing. https://bugzilla.gnome.org/show_bug.cgi?id=752603
-rw-r--r--gst/isomp4/qtdemux.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c
index b5b35fee6..b06060d38 100644
--- a/gst/isomp4/qtdemux.c
+++ b/gst/isomp4/qtdemux.c
@@ -4829,6 +4829,7 @@ gst_qtdemux_stream_update_segment (GstQTDemux * qtdemux, QtDemuxStream * stream,
{
QtDemuxSegment *segment;
GstClockTime start = 0, stop = GST_CLOCK_TIME_NONE, time = 0;
+ GstClockTime min_ts;
gdouble rate;
GstEvent *event;
@@ -4867,17 +4868,20 @@ gst_qtdemux_stream_update_segment (GstQTDemux * qtdemux, QtDemuxStream * stream,
/* Copy flags from main segment */
stream->segment.flags = qtdemux->segment.flags;
+ /* need to offset with the start time of the first sample */
+ min_ts = gst_qtdemux_streams_get_first_sample_ts (qtdemux);
+
/* update the segment values used for clipping */
stream->segment.offset = qtdemux->segment.offset;
stream->segment.base = qtdemux->segment.base + stream->accumulated_base;
stream->segment.applied_rate = qtdemux->segment.applied_rate;
stream->segment.rate = rate;
stream->segment.start = start + QTSTREAMTIME_TO_GSTTIME (stream,
- stream->cslg_shift);
+ stream->cslg_shift) + min_ts;
stream->segment.stop = stop + QTSTREAMTIME_TO_GSTTIME (stream,
- stream->cslg_shift);
- stream->segment.time = time;
- stream->segment.position = stream->segment.start;
+ stream->cslg_shift) + min_ts;
+ stream->segment.time = time + min_ts;
+ stream->segment.position = stream->segment.start + min_ts;
GST_DEBUG_OBJECT (stream->pad, "New segment: %" GST_SEGMENT_FORMAT,
&stream->segment);
@@ -12200,7 +12204,7 @@ qtdemux_update_streams (GstQTDemux * qtdemux)
/* Count n_streams again */
qtdemux->n_streams = 0;
- for (iter = qtdemux->active_streams;iter; iter = next) {
+ for (iter = qtdemux->active_streams; iter; iter = next) {
GList *tmp;
QtDemuxStream *stream = QTDEMUX_STREAM (iter->data);