提交 b98404ef authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

Don't generate SDP m= line without codecs (fixes #67)

上级 09359951
......@@ -318,7 +318,6 @@ class RTCPeerConnectionPlanB extends RTCPeerConnectionCommon
objMedia.setup = transport.dtlsLocalParameters.role === 'client' ? 'active' : 'passive';
// a=direction attribute.
// TODO: Always?
objMedia.direction = 'sendrecv';
objMedia.rtp = [];
......@@ -386,6 +385,15 @@ class RTCPeerConnectionPlanB extends RTCPeerConnectionCommon
}
}
// If there are no codecs, set this m section as unavailable.
if (payloads.length === 0)
{
objMedia.payloads = '7'; // I don't care.
objMedia.port = 0;
objMedia.direction = 'inactive';
}
else
{
// Codec payloads.
objMedia.payloads = payloads.join(' ');
......@@ -452,6 +460,7 @@ class RTCPeerConnectionPlanB extends RTCPeerConnectionCommon
{ type: 'AS', limit : self._options.bandwidth[kind] }
];
}
}
// Add the media section.
obj.media.push(objMedia);
......
......@@ -257,8 +257,20 @@ class RTCRtpTransceiver
}
}
// If there are no codecs, set this m section as unavailable.
if (payloads.length === 0)
{
closed = true;
objMedia.payloads = '7'; // I don't care.
objMedia.port = 0;
objMedia.direction = 'inactive';
}
else
{
// Codec payloads.
objMedia.payloads = payloads.join(' ');
}
// SSCR and CNAME if sender.
if (this._sender && !this._sender.closed)
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论