summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2015-06-25 20:19:34 +0200
committerSebastian Dröge <sebastian@centricular.com>2015-06-25 23:36:09 +0200
commit95eb1aa49c130bb2f58ec6712bd8cb8b61326b99 (patch)
tree41f3ebe6bcca8bcb70f73c0b13f3366d8c28a609 /ext
parente671ad25a989cb21c62c7a5867c2090890ce49ba (diff)
downloadgstreamer-plugins-bad-95eb1aa49c130bb2f58ec6712bd8cb8b61326b99.tar.gz
dashdemux: Subtract the period start when seeking based on a template
Otherwise we will look for segments after the period usually. The seek timestamp is relative to the start of the first period and we have to select a segment relative to the current period's start.
Diffstat (limited to 'ext')
-rw-r--r--ext/dash/gstmpdparser.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/ext/dash/gstmpdparser.c b/ext/dash/gstmpdparser.c
index 69927ccff..d5f99564a 100644
--- a/ext/dash/gstmpdparser.c
+++ b/ext/dash/gstmpdparser.c
@@ -3614,6 +3614,7 @@ gst_mpd_client_stream_seek (GstMpdClient * client, GstActiveStream * stream,
} else {
GstClockTime duration =
gst_mpd_client_get_segment_duration (client, stream, NULL);
+ GstStreamPeriod *stream_period = gst_mpdparser_get_stream_period (client);
guint segments_count = gst_mpd_client_get_segments_counts (client, stream);
g_return_val_if_fail (stream->cur_seg_template->
@@ -3621,6 +3622,12 @@ gst_mpd_client_stream_seek (GstMpdClient * client, GstActiveStream * stream,
if (!GST_CLOCK_TIME_IS_VALID (duration)) {
return FALSE;
}
+
+ if (ts > stream_period->start)
+ ts -= stream_period->start;
+ else
+ ts = 0;
+
index = ts / duration;
if (segments_count > 0 && index >= segments_count) {
stream->segment_index = segments_count;