summaryrefslogtreecommitdiff
path: root/libavformat/sdp.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-09-29 20:26:12 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-09-29 20:26:15 +0200
commit77ab7407c2728de7517be81311bf84426b898685 (patch)
tree647020719aefa75e563a94d099f92df99a11a8d4 /libavformat/sdp.c
parentcf32181b70116309b3a33c8f6bf017a0d0a33089 (diff)
parenta05f5052fef3b3743fab7846da12861d8a8098ec (diff)
Merge commit 'a05f5052fef3b3743fab7846da12861d8a8098ec'
* commit 'a05f5052fef3b3743fab7846da12861d8a8098ec': sdp: Make opus declaration conform to the spec Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/sdp.c')
-rw-r--r--libavformat/sdp.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/libavformat/sdp.c b/libavformat/sdp.c
index a926cf89f2..d7429523e8 100644
--- a/libavformat/sdp.c
+++ b/libavformat/sdp.c
@@ -597,8 +597,18 @@ static char *sdp_write_media_attributes(char *buff, int size, AVCodecContext *c,
}
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... */