summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier CrĂȘte <olivier.crete@collabora.com>2021-08-18 19:36:07 -0400
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>2021-08-30 17:01:15 +0000
commitf70ccd6d86fb3bb26b327f3c27a1e0f7c7e3a3be (patch)
tree70c7aab9d6f8458c1c3b1a30df9ff6ecd94bb66d
parent23d07f3c7b32baaaa644f4b342a8c7ec51c0fb9a (diff)
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: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/1058>
-rw-r--r--gst/rtpmanager/gstrtphdrext-rfc6464.c8
1 files 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,