From 4a025d77acb14cd93df9b0603767c1182deba9b3 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Thu, 23 Apr 2020 16:10:24 -0400 Subject: [PATCH] basesrc: Fix the way position is computed in reverse playback In reverse playback, buffers are played back from buffer.stop (buffer.pts + buffer.duration) to buffer.pts, which means that the position after the buffer is consumed is buffer.pts, not buffer.pts - buffer.duration. Without that change, and when `automatic_eos` feature is on, we were dropping the last buffers as marking the stream EOS one buffer too soon. This is now being tested extensively by GstValidate in the `validate.test.clock_sync.*` set of tests. Part-of: --- libs/gst/base/gstbasesrc.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/libs/gst/base/gstbasesrc.c b/libs/gst/base/gstbasesrc.c index be6dc4669f..d235a48547 100644 --- a/libs/gst/base/gstbasesrc.c +++ b/libs/gst/base/gstbasesrc.c @@ -2918,10 +2918,6 @@ gst_base_src_loop (GstPad * pad) if (GST_CLOCK_TIME_IS_VALID (duration)) { if (src->segment.rate >= 0.0) position += duration; - else if (position > duration) - position -= duration; - else - position = 0; } break; }