From 4830bbe6ca215647ff282df4c76c420e924d5ab3 Mon Sep 17 00:00:00 2001 From: Mathieu Duponchelle Date: Fri, 26 Jul 2019 02:45:51 +0200 Subject: [PATCH] qtdemux: fix reverse playback EOS conditions In reverse playback, we don't want to rely on the position of the current keyframe to decide a stream is EOS: the last GOP we push will start with a keyframe, which position is likely to be outside of the segment. Instead, let the normal seek_to_previous_keyframe mechanism do its job, it works just fine. --- gst/isomp4/qtdemux.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c index ad2192acbf..d8c434e6f5 100644 --- a/gst/isomp4/qtdemux.c +++ b/gst/isomp4/qtdemux.c @@ -6337,10 +6337,8 @@ gst_qtdemux_loop_state_movie (GstQTDemux * qtdemux) /* check for segment end */ if (G_UNLIKELY (qtdemux->segment.stop != -1 - && ((qtdemux->segment.rate >= 0 && qtdemux->segment.stop <= min_time) - || (qtdemux->segment.rate < 0 - && qtdemux->segment.start > min_time)) - && target_stream->on_keyframe)) { + && qtdemux->segment.rate >= 0 + && qtdemux->segment.stop <= min_time && target_stream->on_keyframe)) { GST_DEBUG_OBJECT (qtdemux, "we reached the end of our segment."); target_stream->time_position = GST_CLOCK_TIME_NONE; goto eos_stream;