adaptivedemux: Properly handle presentationTimeOffset for seeking and multi-period...
authorSebastian Dröge <sebastian@centricular.com>
Thu, 25 Jun 2015 21:32:10 +0000 (23:32 +0200)
committerSebastian Dröge <sebastian@centricular.com>
Thu, 25 Jun 2015 21:36:25 +0000 (23:36 +0200)
commit548ed60e86b21c55ab566a32eb60a109d4757587
treece2f5032c53aa93297d45cd2a06ed8f5adc31bd1
parent626a8f0a74f8ea748b811b74ba9e7ae2baea2cca
adaptivedemux: Properly handle presentationTimeOffset for seeking and multi-period streams

Segment start/time/position/base should only be modified if this is the first
time we send a segment, otherwise we will override values from the seek
segment if new streams have to be exposed as part of the seek.

Segment base should be calculated from the segment start based on the stream's
own segment, not the demuxer's segment. Both might differ slightly because of
the presentationTimeOffset.

Always add the presentationTimeOffset (relative to the period start, not
timestamp 0) to the segment start after resetting the stream's segment based
on the demuxer's segment (i.e. after seeks or stream restart). Also make sure
to keep the stream's segment up to date and not just send a new segment event
without storing the segment in the stream.

https://bugzilla.gnome.org/show_bug.cgi?id=745455
gst-libs/gst/adaptivedemux/gstadaptivedemux.c