adaptivedemux2: Always check bitrate in live

When advancing fragment in live, it's normal to return
GST_FLOW_EOS when playing at the live edge of the available
fragments. In that case, we still want to adjust bitrate
dynamically.

Fixes issue with dashdemux2 where the current bitrate of
each adaptation set is changed to the lowest one when
updating the mpd for a live stream.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3020>
This commit is contained in:
Jan Schmidt 2022-09-13 00:56:53 +10:00 committed by GStreamer Marge Bot
parent 5666debd5f
commit e5e72ede26

View file

@ -3969,7 +3969,10 @@ gst_adaptive_demux2_stream_advance_fragment_unlocked (GstAdaptiveDemux * demux,
stream->download_start_time =
GST_TIME_AS_USECONDS (gst_adaptive_demux2_get_monotonic_time (demux));
if (ret == GST_FLOW_OK) {
/* Always check if we need to switch bitrate on OK, or when live
* (it's normal to have EOS on advancing in live when we hit the
* end of the manifest) */
if (ret == GST_FLOW_OK || gst_adaptive_demux_is_live (demux)) {
GST_DEBUG_OBJECT (stream, "checking if stream requires bitrate change");
if (gst_adaptive_demux2_stream_select_bitrate (demux, stream,
gst_adaptive_demux2_stream_update_current_bitrate (demux,