From 0bd3f2352c532faf152be1b6d2ac289cb6fb0d40 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 9 Jun 2016 19:02:49 +0300 Subject: [PATCH] videodecoder: Use input segment rate instead of output segment rate to decide whether the drain on keyframes The output segment is only set up after data is output, which might be far in the future for reverse playback. Also we are here interested in the state at the current *input* frame (which is the keyframe), not any possible output. --- gst-libs/gst/video/gstvideodecoder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gst-libs/gst/video/gstvideodecoder.c b/gst-libs/gst/video/gstvideodecoder.c index 61c44c2..2e480a4 100644 --- a/gst-libs/gst/video/gstvideodecoder.c +++ b/gst-libs/gst/video/gstvideodecoder.c @@ -2216,7 +2216,7 @@ gst_video_decoder_chain_forward (GstVideoDecoder * decoder, * Also this function is only called for reverse playback to gather frames * GOP by GOP, and does not do any actual decoding. That would be done by * flush_decode() */ - if (was_keyframe && decoder->output_segment.rate > 0.0 + if (was_keyframe && decoder->input_segment.rate > 0.0 && (decoder->output_segment.flags & GST_SEEK_FLAG_TRICKMODE_KEY_UNITS)) gst_video_decoder_drain_out (decoder, FALSE); } else { -- 2.7.4