From f70ccd6d86fb3bb26b327f3c27a1e0f7c7e3a3be Mon Sep 17 00:00:00 2001 From: Olivier CrĂȘte Date: Wed, 18 Aug 2021 19:36:07 -0400 Subject: rtphdrext-rfc6464: Put max level if the audio is beyond it Otherwise, it just fails to add the extension, which makes no sense. And our level element produces levels higher than 127 in some cases. Part-of: --- gst/rtpmanager/gstrtphdrext-rfc6464.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gst/rtpmanager/gstrtphdrext-rfc6464.c b/gst/rtpmanager/gstrtphdrext-rfc6464.c index 3aefa3cf1..1dc1f0f43 100644 --- a/gst/rtpmanager/gstrtphdrext-rfc6464.c +++ b/gst/rtpmanager/gstrtphdrext-rfc6464.c @@ -219,6 +219,7 @@ gst_rtp_header_extension_rfc6464_write (GstRTPHeaderExtension * ext, GstBuffer * output, guint8 * data, gsize size) { GstAudioLevelMeta *meta; + guint level; g_return_val_if_fail (size >= gst_rtp_header_extension_rfc6464_get_max_size (ext, NULL), -1); @@ -231,10 +232,11 @@ gst_rtp_header_extension_rfc6464_write (GstRTPHeaderExtension * ext, return 0; } - if (meta->level > 127) { - GST_WARNING_OBJECT (ext, "level from meta is higher than 127: %d", + level = meta->level; + if (level > 127) { + GST_LOG_OBJECT (ext, "level from meta is higher than 127: %d, cropping", meta->level); - return -1; + level = 127; } GST_LOG_OBJECT (ext, "writing ext (level: %d voice: %d)", meta->level, -- cgit v1.2.3