adaptivedemux2: Fix for period switching in live streams
authorJan Schmidt <jan@centricular.com>
Fri, 12 Aug 2022 11:57:25 +0000 (21:57 +1000)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Tue, 16 Aug 2022 12:39:58 +0000 (12:39 +0000)
commitf4f1819416f977b3c09382eb8715e0022e8ec41b
treee14004e412a4add8a2e8b77c49cd266b49402252
parentdbc8a7ab18e8fe6abf6c207d7076caefdbed0a0c
adaptivedemux2: Fix for period switching in live streams

When playing live, it's possible that one stream reaches
the end of the available playback window and goes to sleep
waiting for a manifest update, and the manifest update
introduces a new period. In that case, the sleeping
stream needs to wake up and go 'properly' EOS before we
can advance the input to the new period.

Accordingly, make sure that a stream's last_ret value
is not marked as EOS if it's just sleeping waiting for a live
manifest update.

Also fix the output loop to go back and re-check if it's
time to switch to the next period after dequeuing and
discarding an EOS event.

https://livesim.dashif.org/livesim/periods_20/testpic_2s/Manifest.mpd

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