From e5e72ede267bfbc72a3af50fbc07957c20b022ea Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Tue, 13 Sep 2022 00:56:53 +1000 Subject: [PATCH] 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: --- subprojects/gst-plugins-good/ext/adaptivedemux2/gstadaptivedemux.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/subprojects/gst-plugins-good/ext/adaptivedemux2/gstadaptivedemux.c b/subprojects/gst-plugins-good/ext/adaptivedemux2/gstadaptivedemux.c index 0f7e7b0..f7eae66 100644 --- a/subprojects/gst-plugins-good/ext/adaptivedemux2/gstadaptivedemux.c +++ b/subprojects/gst-plugins-good/ext/adaptivedemux2/gstadaptivedemux.c @@ -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, -- 2.7.4