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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/450>
This commit is contained in:
Thibault Saunier 2020-04-23 16:10:24 -04:00 committed by GStreamer Merge Bot
parent dc1a1e5275
commit 4a025d77ac

View file

@ -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;
}