videorate: Fix buffer selection logic in reverse playback
authorThibault Saunier <tsaunier@igalia.com>
Mon, 25 May 2020 20:59:53 +0000 (16:59 -0400)
committerThibault Saunier <tsaunier@igalia.com>
Tue, 26 May 2020 19:35:00 +0000 (15:35 -0400)
commit97fe599c0fa05dfafce8a8c87997b70b693cfbbd
treef26600cf300688bba6e730a1e02443318a3c39ed
parent6e82eb28f3f61fe7de1de36d353f21883ca52119
videorate: Fix buffer selection logic in reverse playback

Stop comparing all timestamps from buffers that are before the segment
with the segment.stop and compare with the actual end times.

Comparing to segment.stop for all the buffers that where before
the segment.stop was incorrect and leading to consuming wrong buffers
and not respecting segment.stop, this is now properly tested.

Expectations for `reverse.10_to_1fps.validatetest` have been fixed to
take that into account and comparing the checksums of the sinkpad and
srcpad expectations makes pretty clear how wrong that was.

(we can see in the expectations that videotestsrc outputs an extra
buffer with pts == segment.stop and this one is now properly dropped
by videorate as bec7f4ad5ed4bb1abfb92db946e654338766562b aimed at
doing)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/668>
17 files changed:
gst/videorate/gstvideorate.c
tests/validate/meson.build
tests/validate/videorate/reverse.10_to_1fps.validatetest
tests/validate/videorate/reverse.10_to_1fps/flow-expectations/log-videorate-sink-expected
tests/validate/videorate/reverse.10_to_1fps/flow-expectations/log-videorate-src-expected
tests/validate/videorate/reverse.10_to_30fps.validatetest [new file with mode: 0644]
tests/validate/videorate/reverse.10_to_30fps/flow-expectations/log-videorate-sink-expected [new file with mode: 0644]
tests/validate/videorate/reverse.10_to_30fps/flow-expectations/log-videorate-src-expected [new file with mode: 0644]
tests/validate/videorate/reverse.1_to_10fps.validatetest [new file with mode: 0644]
tests/validate/videorate/reverse.1_to_10fps/flow-expectations/log-videorate-sink-expected [new file with mode: 0644]
tests/validate/videorate/reverse.1_to_10fps/flow-expectations/log-videorate-src-expected [new file with mode: 0644]
tests/validate/videorate/reverse.30fps.validatetest [new file with mode: 0644]
tests/validate/videorate/reverse.30fps/flow-expectations/log-videorate-sink-expected [new file with mode: 0644]
tests/validate/videorate/reverse.30fps/flow-expectations/log-videorate-src-expected [new file with mode: 0644]
tests/validate/videorate/reverse.variable_to_10fps.validatetest [new file with mode: 0644]
tests/validate/videorate/reverse.variable_to_10fps/flow-expectations/log-videorate-sink-expected [new file with mode: 0644]
tests/validate/videorate/reverse.variable_to_10fps/flow-expectations/log-videorate-src-expected [new file with mode: 0644]