mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 23:06:49 +00:00
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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5893>
This commit is contained in:
parent
e3be7e3162
commit
00bbac6541
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue