videorate: Handle closing segment on EOS right after caps event
authorThibault Saunier <tsaunier@igalia.com>
Wed, 14 Sep 2022 19:39:48 +0000 (16:39 -0300)
committerThibault Saunier <tsaunier@igalia.com>
Tue, 11 Oct 2022 14:48:09 +0000 (11:48 -0300)
commit11b83fb2fc513f94e42c1ffd4e3b57e845c5909a
tree7553916a1769849f326f706882b1d508c9665bc3
parent55dd7ff4b4b8459eab93d6da6b76cc6d9771fa06
videorate: Handle closing segment on EOS right after caps event

The scenario is what we try in the tests:
- we have a segment with .stop set
- some frame(s) flow
- we get a CAPS event
- we get an EOS (before getting buffers after the CAPS event)

in that case, without that patch, the segment is not properly closed
which is not correct. In this patch we keep track of previous caps until
a new buffer arrives, this way in that situation we set previous caps
again, and close the segment with the previous buffer.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1352
in this specific case

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3059>
subprojects/gst-plugins-base/gst/videorate/gstvideorate.c
subprojects/gst-plugins-base/gst/videorate/gstvideorate.h
subprojects/gst-plugins-base/tests/validate/meson.build
subprojects/gst-plugins-base/tests/validate/videorate/fill_segment_after_caps_changed_before_eos.validatetest [new file with mode: 0644]
subprojects/gst-plugins-base/tests/validate/videorate/fill_segment_after_caps_changed_before_eos/flow-expectations/log-videorate-sink-expected [new file with mode: 0644]
subprojects/gst-plugins-base/tests/validate/videorate/fill_segment_after_caps_changed_before_eos/flow-expectations/log-videorate-src-expected [new file with mode: 0644]