From 00bbac6541bf28b32879f2897e2f20f086042b5b Mon Sep 17 00:00:00 2001 From: Sanchayan Maity Date: Thu, 16 Nov 2023 11:42:27 +0530 Subject: [PATCH] rtphdrext-clientaudiolevel: Fix level value being written by the extension When level value is greater than 127, it was being clamped but this clamped value was not the one being actually used. For level values greater than 127 this resulted in an incorrect value being used. As an example, a level value of 187, after and'ed with 0x7F, it would result in 0x3B being reported as the level value. Part-of: --- .../gst/rtpmanager/gstrtphdrext-clientaudiolevel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subprojects/gst-plugins-good/gst/rtpmanager/gstrtphdrext-clientaudiolevel.c b/subprojects/gst-plugins-good/gst/rtpmanager/gstrtphdrext-clientaudiolevel.c index 4012e18bc2..d6f98c24b7 100644 --- a/subprojects/gst-plugins-good/gst/rtpmanager/gstrtphdrext-clientaudiolevel.c +++ b/subprojects/gst-plugins-good/gst/rtpmanager/gstrtphdrext-clientaudiolevel.c @@ -176,11 +176,11 @@ gst_rtp_header_extension_client_audio_level_write (GstRTPHeaderExtension * ext, level = 127; } - GST_LOG_OBJECT (ext, "writing ext (level: %d voice: %d)", meta->level, + GST_LOG_OBJECT (ext, "writing ext (level: %d voice: %d)", level, meta->voice_activity); /* Both one & two byte use the same format, the second byte being padding */ - data[0] = (meta->level & 0x7F) | (meta->voice_activity << 7); + data[0] = (level & 0x7F) | (meta->voice_activity << 7); if (write_flags & GST_RTP_HEADER_EXTENSION_ONE_BYTE) { return 1; }