aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2022-08-06 17:40:52 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2022-08-07 02:12:14 +0200
commitacfe4f670ec29ffb328447808eb9ad02caee1055 (patch)
tree3f87d7a4298dae0a2e9214fdc1149e116e2db95b
parent6c14d5341e0863a5f1fbb90992e6c44dac5793b6 (diff)
sdp_msg_to_sdp_str fu
-rw-r--r--src/libmsc/sdp_msg.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/libmsc/sdp_msg.c b/src/libmsc/sdp_msg.c
index e96235a5c..ff8265a33 100644
--- a/src/libmsc/sdp_msg.c
+++ b/src/libmsc/sdp_msg.c
@@ -245,11 +245,10 @@ int sdp_msg_to_sdp_str_buf(char *dst, size_t dst_size, const struct sdp_msg *sdp
/* Add details for all codecs */
foreach_sdp_audio_codec(codec, &sdp->audio_codecs) {
- if (codec->subtype_name[0]) {
- OSMO_STRBUF_PRINTF(sb, "a=rtpmap:%d %s/%d\r\n", codec->payload_type, codec->subtype_name,
- codec->rate > 0? codec->rate : 8000);
- }
-
+ if (!sdp_audio_codec_is_set(codec))
+ continue;
+ OSMO_STRBUF_PRINTF(sb, "a=rtpmap:%d %s/%d\r\n", codec->payload_type, codec->subtype_name,
+ codec->rate > 0? codec->rate : 8000);
if (codec->fmtp[0])
OSMO_STRBUF_PRINTF(sb, "a=fmtp:%d %s\r\n", codec->payload_type, codec->fmtp);
}