summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2018-06-15 12:54:20 +0300
committerSebastian Dröge <sebastian@centricular.com>2018-06-15 12:54:20 +0300
commit7db0965014621ddf6a28b56310f41b08ea6fef73 (patch)
tree23616fa7dc8880da9fb9274b8e54c79c969602cb
parentae99f2c261406ebaf24a1964683b79d7390cfacc (diff)
qtdemux: Only ever update segment.position in the right directioninstant-rate-change
Otherwise non-flushing seeks or seeks with start_type=NONE will behave wrong by jumping to the wrong position.
-rw-r--r--gst/isomp4/qtdemux.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c
index d1791b6d6..188f0058d 100644
--- a/gst/isomp4/qtdemux.c
+++ b/gst/isomp4/qtdemux.c
@@ -4637,7 +4637,7 @@ gst_qtdemux_seek_to_previous_keyframe (GstQTDemux * qtdemux)
k_index, GST_TIME_ARGS (k_pos));
/* Set last_stop with the keyframe timestamp we pushed of that stream */
- qtdemux->segment.position = last_stop;
+ qtdemux->segment.position = MIN (qtdemux->segment.position, last_stop);
GST_DEBUG_OBJECT (qtdemux, "last_stop now is %" GST_TIME_FORMAT,
GST_TIME_ARGS (last_stop));
@@ -5499,7 +5499,7 @@ gst_qtdemux_decorate_and_push_buffer (GstQTDemux * qtdemux,
/* position reporting */
if (qtdemux->segment.rate >= 0) {
- qtdemux->segment.position = position;
+ qtdemux->segment.position = MAX (qtdemux->segment.position, position);
gst_qtdemux_sync_streams (qtdemux);
}