adaptivedemux2: stream: Set period has_next_period flag before EOS
authorJan Schmidt <jan@centricular.com>
Mon, 11 Jul 2022 15:55:54 +0000 (01:55 +1000)
committerTim-Philipp Müller <tim@centricular.com>
Thu, 4 Aug 2022 12:43:51 +0000 (13:43 +0100)
commitde7e2c9b6b8f58aa59ee7377d446deeb980def6b
tree35bab2a0e87131ee2c776eea9db0bc45a5b243f4
parent1863082efa14fb52a8426c983bb4a0aee0095b7b
adaptivedemux2: stream: Set period has_next_period flag before EOS

Before sending EOS, update the period's has_next_period
flag and/or create the next period. This closes a race
where the output loop might receive the EOS event
and either push it downstream (causing premature EOS),
or receive it and try and switch to the next period
before that period is completely set up.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2838>
subprojects/gst-plugins-good/ext/adaptivedemux2/gstadaptivedemux-stream.c