requested to merge thiblahute/gstreamer:close_segments_on_caps_plus_eos into main
The scenario is what we try in the tests:
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: #1352 (closed) in this specific case