]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
bridge: Don't try to match audio formats.
authorJoshua C. Colp <jcolp@sangoma.com>
Mon, 18 May 2020 14:05:56 +0000 (11:05 -0300)
committerJoshua Colp <jcolp@sangoma.com>
Fri, 26 Feb 2021 15:12:59 +0000 (09:12 -0600)
When bridging channels we were trying to match the audio
formats of both sides in combination with the configured
formats. While this is allowed in SDP in practice this
causes extra reinvites and problems. This change ensures
that audio streams use the formats of the first existing
active audio stream. It is only when other stream types
(like video) exist that this will result in re-negotiation
occurring for those streams only.

ASTERISK-28871

Change-Id: I22f5a3e7db29e00c165e74d05d10856f6086fe47

bridges/bridge_native_rtp.c
bridges/bridge_simple.c

index a6addf27110391fbfebb56ba8bc1eab5ec296486..2853b990cbba8d353f26528e18418dca98c93a1f 100644 (file)
@@ -893,8 +893,8 @@ static struct ast_stream_topology *native_rtp_request_stream_topology_update(
                                continue;
                        }
 
-                       ast_format_cap_append_from_cap(ast_stream_get_formats(stream), audio_formats,
-                               AST_MEDIA_TYPE_AUDIO);
+                       /* We haven't actually modified audio_formats so this is safe */
+                       ast_stream_set_formats(stream, (struct ast_format_cap *)audio_formats);
                }
        }
 
index 545b3ad1cbe04be718e22dfe757ac239184d1ff6..1750d2739028160b73733f2a9b55c61b314603b9 100644 (file)
@@ -97,8 +97,8 @@ static struct ast_stream_topology *simple_bridge_request_stream_topology_update(
                                continue;
                        }
 
-                       ast_format_cap_append_from_cap(ast_stream_get_formats(stream), audio_formats,
-                               AST_MEDIA_TYPE_AUDIO);
+                       /* We haven't actually modified audio_formats so this is safe */
+                       ast_stream_set_formats(stream, (struct ast_format_cap *)audio_formats);
                }
        }