qtdemux: Adjust segment according to ctts offset

In presence of a CTTS, the segment start/stop must be offset so
the segment start/stop include the PTS. This is needed since the
PTS cannot be negative in this format. This fixes issues where the
running time of the first buffer isn't at the start.

https://bugzilla.gnome.org/show_bug.cgi?id=740575
This commit is contained in:
Nicolas Dufresne 2015-06-11 17:26:49 -04:00
parent 12181efddc
commit 135e516730

View file

@ -3749,10 +3749,12 @@ gst_qtdemux_activate_segment (GstQTDemux * qtdemux, QtDemuxStream * stream,
stream->segment.base = qtdemux->segment.base;
stream->segment.applied_rate = qtdemux->segment.applied_rate;
stream->segment.rate = rate;
stream->segment.start = start;
stream->segment.stop = stop;
stream->segment.start = start +
QTSTREAMTIME_TO_GSTTIME (stream, stream->ctts_soffset);
stream->segment.stop = stop +
QTSTREAMTIME_TO_GSTTIME (stream, stream->ctts_soffset);
stream->segment.time = time;
stream->segment.position = start;
stream->segment.position = stream->segment.start;
/* now prepare and send the segment */
if (stream->pad) {