From 303bda4d65253a0b27876d4d7d19d8d575acc7de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Dzi=C4=99giel?= Date: Sat, 16 Nov 2024 15:25:01 +0100 Subject: [PATCH] clapper: Do not reset "adaptive-bandwidth" to zero When new instance of adaptive demuxer is created (different video is played) this prop value would become zero. We want to avoid that and instead report only bandwidth after fragment is downloaded, so when video will be unplayable, next one will not start from lowest quality. --- src/lib/clapper/clapper-player.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lib/clapper/clapper-player.c b/src/lib/clapper/clapper-player.c index de1728f8..52f4e22c 100644 --- a/src/lib/clapper/clapper-player.c +++ b/src/lib/clapper/clapper-player.c @@ -726,6 +726,11 @@ _adaptive_demuxer_bandwidth_changed_cb (GstElement *adaptive_demuxer, g_object_get (adaptive_demuxer, "current-bandwidth", &bandwidth, NULL); + /* Skip uncalculated bandwidth from + * new adaptive demuxer instance */ + if (bandwidth == 0) + return; + GST_OBJECT_LOCK (self); if ((changed = bandwidth != self->bandwidth)) self->bandwidth = bandwidth;