summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Santos <ts.santos@partner.samsung.com>2013-09-24 10:08:10 -0700
committerThiago Santos <ts.santos@partner.samsung.com>2013-09-24 14:43:34 -0700
commit556055e2f1e2238c0d9cb67b0922635b69917f97 (patch)
tree8780afded096896365e73b2bff712288264032f0
parentabe5ca6d962fdd34c1292b71f72495475eac2174 (diff)
asfdemux: Only use segment.start as seek_time if it is relative
Relying on the gst_segment_do_seek results for getting the seeking time should not be used if seek type is SET because the do_seek function makes the 'cur` position of the seek normalized on the segment range. This means that seeking beyond the end of the file might not result in instant EOS as it will end up seeking to the final ts of the file. In asf seeking to the final timestamp can lead to seeking to the last keyframe, meaning a few seconds of video will still be played, which should not be the desired behavior when seeking beyong file limits.
-rw-r--r--gst/asfdemux/gstasfdemux.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gst/asfdemux/gstasfdemux.c b/gst/asfdemux/gstasfdemux.c
index 0432503a..a19d223c 100644
--- a/gst/asfdemux/gstasfdemux.c
+++ b/gst/asfdemux/gstasfdemux.c
@@ -719,7 +719,10 @@ gst_asf_demux_handle_seek_event (GstASFDemux * demux, GstEvent * event)
GST_DEBUG_OBJECT (demux, "seeking to time %" GST_TIME_FORMAT ", segment: "
"%" GST_SEGMENT_FORMAT, GST_TIME_ARGS (segment.start), &segment);
- seek_time = segment.start;
+ if (cur_type != GST_SEEK_TYPE_SET)
+ seek_time = segment.start;
+ else
+ seek_time = cur;
/* FIXME: should check the KEY_UNIT flag; need to adjust position to
* real start of data and segment_start to indexed time for key unit seek*/