dashdemux: Fix SEEK of multi-period On-Demand profile

For each period, media presentation is the relative to the
period-start time. So SIDX seek position should be target seek
position minus period-start. Also, if presentationTimeOffset
is defined, the value should be compensated

https://bugzilla.gnome.org/show_bug.cgi?id=780397
This commit is contained in:
Seungha Yang 2017-03-24 08:16:35 +09:00 committed by Sebastian Dröge
parent 28e0bdb7fe
commit 41996ad9c0

View file

@ -1341,6 +1341,18 @@ gst_dash_demux_stream_seek (GstAdaptiveDemuxStream * stream, gboolean forward,
forward, flags, ts, final_ts);
if (gst_mpd_client_has_isoff_ondemand_profile (dashdemux->client)) {
GstClockTime period_start, offset;
period_start = gst_mpd_parser_get_period_start_time (dashdemux->client);
offset =
gst_mpd_parser_get_stream_presentation_offset (dashdemux->client,
dashstream->index);
if (G_UNLIKELY (ts < period_start))
ts = offset;
else
ts += offset - period_start;
if (last_index != dashstream->active_stream->segment_index ||
last_repeat != dashstream->active_stream->segment_repeat_index) {
GST_LOG_OBJECT (stream->pad,