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

Fix parsing of RTP header extensions.

上级 ce725b6f
......@@ -580,10 +580,17 @@ class RTCPeerConnectionPlanB extends EventEmitter
{
for (let ext of parsedMedia.ext)
{
let id = ext.value;
let uri = ext.uri;
// TODO: Hack for https://github.com/clux/sdp-transform/issues/51
if (typeof id !== 'number')
id = parseInt(id);
headerExtensions.push(
{
uri : ext.uri,
id : ext.value
uri : uri,
id : id
});
}
}
......
......@@ -88,11 +88,18 @@ module.exports =
{
for (let ext of parsedMedia.ext)
{
let preferredId = ext.value;
let uri = ext.uri;
// TODO: Hack for https://github.com/clux/sdp-transform/issues/51
if (typeof preferredId !== 'number')
preferredId = parseInt(preferredId);
let headerExtension =
{
kind : kind,
uri : ext.uri,
preferredId : ext.value
uri : uri,
preferredId : preferredId
};
// If same preferredId was already in the map with a different kind,
......
......@@ -39,7 +39,7 @@ namespace RTC
MS_THROW_ERROR("empty RtpHeaderExtension.uri");
// `preferredId` is mandatory.
if (!data[k_preferredId].asUInt())
if (!data[k_preferredId].isUInt())
MS_THROW_ERROR("missing RtpHeaderExtension.preferredId");
this->preferredId = (uint16_t)data[k_preferredId].asUInt();
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论