Err, trying again with an actual attached patch
>From 983a39d730f7d961e25befada3951f3285a82155 Mon Sep 17 00:00:00 2001
From: "Timothy B. Terriberry" <[email protected]>
Date: Wed, 24 Sep 2014 17:43:22 -0700
Subject: [PATCH] sdp: Make opus declaration conform to the spec
---
libavformat/sdp.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/libavformat/sdp.c b/libavformat/sdp.c
index 3c39ac7..eccd676 100644
--- a/libavformat/sdp.c
+++ b/libavformat/sdp.c
@@ -578,18 +578,28 @@ static char *sdp_write_media_attributes(char *buff, int size, AVCodecContext *c,
payload_type, c->sample_rate,
payload_type, c->block_align == 38 ? 20 : 30);
break;
case AV_CODEC_ID_SPEEX:
av_strlcatf(buff, size, "a=rtpmap:%d speex/%d\r\n",
payload_type, c->sample_rate);
break;
case AV_CODEC_ID_OPUS:
- av_strlcatf(buff, size, "a=rtpmap:%d opus/48000\r\n",
+ /* The opus RTP draft says that all opus streams MUST be declared
+ as stereo, to avoid negotiation failures. The actual number of
+ channels can change on a packet-by-packet basis. The number of
+ channels a receiver prefers to receive or a sender plans to send
+ can be declared via fmtp parameters (both default to mono), but
+ receivers MUST be able to receive and process stereo packets. */
+ av_strlcatf(buff, size, "a=rtpmap:%d opus/48000/2\r\n",
payload_type);
+ if (c->channels == 2) {
+ av_strlcatf(buff, size, "a=fmtp:%d sprop-stereo:1\r\n",
+ payload_type);
+ }
break;
default:
/* Nothing special to do here... */
break;
}
av_free(config);
--
1.8.3.2
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel