Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
03110738
Unverified
提交
03110738
authored
4月 30, 2024
作者:
Iñaki Baz Castillo
提交者:
GitHub
4月 30, 2024
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Stop using C++ auto to assign results of arithmetic operations (#1386)
上级
ecb507e5
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
18 行增加
和
13 行删除
+18
-13
CHANGELOG.md
CHANGELOG.md
+4
-0
FeedbackRtpTransport.cpp
worker/src/RTC/RTCP/FeedbackRtpTransport.cpp
+3
-1
RtpRetransmissionBuffer.cpp
worker/src/RTC/RtpRetransmissionBuffer.cpp
+9
-10
RtxStream.cpp
worker/src/RTC/RtxStream.cpp
+1
-1
TransportCongestionControlServer.cpp
worker/src/RTC/TransportCongestionControlServer.cpp
+1
-1
没有找到文件。
CHANGELOG.md
浏览文件 @
03110738
# Changelog
# Changelog
### NEXT
-
Worker: Fix possible value overflow in
`FeedbackRtpTransport.cpp`
(
[
PR #1386
](
https://github.com/versatica/mediasoup/pull/1386
)
, credits to @Lynnworld).
### 3.14.2
### 3.14.2
-
Update worker subprojects (
[
PR #1376
](
https://github.com/versatica/mediasoup/pull/1376
)
).
-
Update worker subprojects (
[
PR #1376
](
https://github.com/versatica/mediasoup/pull/1376
)
).
...
...
worker/src/RTC/RTCP/FeedbackRtpTransport.cpp
浏览文件 @
03110738
...
@@ -310,7 +310,9 @@ namespace RTC
...
@@ -310,7 +310,9 @@ namespace RTC
// Check if there are too many missing packets.
// Check if there are too many missing packets.
{
{
auto
missingPackets
=
sequenceNumber
-
(
this
->
latestSequenceNumber
+
1
);
// NOTE: We CANNOT use auto here, we must use uint16_t. Otherwise this is a bug.
// https://github.com/versatica/mediasoup/issues/1385#issuecomment-2084982087
const
uint16_t
missingPackets
=
sequenceNumber
-
(
this
->
latestSequenceNumber
+
1
);
if
(
missingPackets
>
FeedbackRtpTransportPacket
::
maxMissingPackets
)
if
(
missingPackets
>
FeedbackRtpTransportPacket
::
maxMissingPackets
)
{
{
...
...
worker/src/RTC/RtpRetransmissionBuffer.cpp
浏览文件 @
03110738
...
@@ -72,9 +72,9 @@ namespace RTC
...
@@ -72,9 +72,9 @@ namespace RTC
return
nullptr
;
return
nullptr
;
}
}
const
auto
idx
=
static_cast
<
uint16_t
>
(
seq
-
oldestItem
->
sequenceNumber
)
;
const
uint16_t
idx
=
seq
-
oldestItem
->
sequenceNumber
;
if
(
idx
>
static_cast
<
uint16_t
>
(
this
->
buffer
.
size
()
-
1
)
)
if
(
static_cast
<
size_t
>
(
idx
)
>
this
->
buffer
.
size
()
-
1
)
{
{
return
nullptr
;
return
nullptr
;
}
}
...
@@ -198,14 +198,13 @@ namespace RTC
...
@@ -198,14 +198,13 @@ namespace RTC
// Calculate how many blank slots it would be necessary to add when
// Calculate how many blank slots it would be necessary to add when
// pushing new item to the back of the buffer.
// pushing new item to the back of the buffer.
auto
numBlankSlots
=
static_cast
<
uint16_t
>
(
seq
-
newestItem
->
sequenceNumber
-
1
)
;
uint16_t
numBlankSlots
=
seq
-
newestItem
->
sequenceNumber
-
1
;
// We may have to remove oldest items not to exceed the maximum size of
// We may have to remove oldest items not to exceed the maximum size of
// the buffer.
// the buffer.
if
(
this
->
buffer
.
size
()
+
numBlankSlots
+
1
>
this
->
maxItems
)
if
(
this
->
buffer
.
size
()
+
numBlankSlots
+
1
>
this
->
maxItems
)
{
{
const
auto
numItemsToRemove
=
const
uint16_t
numItemsToRemove
=
this
->
buffer
.
size
()
+
numBlankSlots
+
1
-
this
->
maxItems
;
static_cast
<
uint16_t
>
(
this
->
buffer
.
size
()
+
numBlankSlots
+
1
-
this
->
maxItems
);
// If num of items to be removed exceed buffer size minus one (needed to
// If num of items to be removed exceed buffer size minus one (needed to
// allocate current packet) then we must clear the entire buffer.
// allocate current packet) then we must clear the entire buffer.
...
@@ -286,7 +285,7 @@ namespace RTC
...
@@ -286,7 +285,7 @@ namespace RTC
// Calculate how many blank slots it would be necessary to add when
// Calculate how many blank slots it would be necessary to add when
// pushing new item to the fton of the buffer.
// pushing new item to the fton of the buffer.
const
auto
numBlankSlots
=
static_cast
<
uint16_t
>
(
oldestItem
->
sequenceNumber
-
seq
-
1
)
;
const
uint16_t
numBlankSlots
=
oldestItem
->
sequenceNumber
-
seq
-
1
;
// If adding this packet (and needed blank slots) to the front makes the
// If adding this packet (and needed blank slots) to the front makes the
// buffer exceed its max size, discard this packet.
// buffer exceed its max size, discard this packet.
...
@@ -339,11 +338,11 @@ namespace RTC
...
@@ -339,11 +338,11 @@ namespace RTC
}
}
// idx is the intended position of the received packet in the buffer.
// idx is the intended position of the received packet in the buffer.
const
auto
idx
=
static_cast
<
uint16_t
>
(
seq
-
oldestItem
->
sequenceNumber
)
;
const
uint16_t
idx
=
seq
-
oldestItem
->
sequenceNumber
;
// Validate that packet timestamp is equal or higher than the timestamp of
// Validate that packet timestamp is equal or higher than the timestamp of
// the immediate older packet (if any).
// the immediate older packet (if any).
for
(
auto
idx2
=
static_cast
<
int32_t
>
(
idx
-
1
)
;
idx2
>=
0
;
--
idx2
)
for
(
int32_t
idx2
=
idx
-
1
;
idx2
>=
0
;
--
idx2
)
{
{
const
auto
*
olderItem
=
this
->
buffer
.
at
(
idx2
);
const
auto
*
olderItem
=
this
->
buffer
.
at
(
idx2
);
...
@@ -374,7 +373,7 @@ namespace RTC
...
@@ -374,7 +373,7 @@ namespace RTC
// Validate that packet timestamp is equal or less than the timestamp of
// Validate that packet timestamp is equal or less than the timestamp of
// the immediate newer packet (if any).
// the immediate newer packet (if any).
for
(
auto
idx2
=
static_cast
<
size_t
>
(
idx
+
1
)
;
idx2
<
this
->
buffer
.
size
();
++
idx2
)
for
(
size_t
idx2
=
idx
+
1
;
idx2
<
this
->
buffer
.
size
();
++
idx2
)
{
{
const
auto
*
newerItem
=
this
->
buffer
.
at
(
idx2
);
const
auto
*
newerItem
=
this
->
buffer
.
at
(
idx2
);
...
@@ -535,7 +534,7 @@ namespace RTC
...
@@ -535,7 +534,7 @@ namespace RTC
numItems
,
numItems
,
this
->
buffer
.
size
());
this
->
buffer
.
size
());
const
auto
intendedBufferSize
=
this
->
buffer
.
size
()
-
numItems
;
const
size_t
intendedBufferSize
=
this
->
buffer
.
size
()
-
numItems
;
while
(
this
->
buffer
.
size
()
>
intendedBufferSize
)
while
(
this
->
buffer
.
size
()
>
intendedBufferSize
)
{
{
...
...
worker/src/RTC/RtxStream.cpp
浏览文件 @
03110738
...
@@ -137,7 +137,7 @@ namespace RTC
...
@@ -137,7 +137,7 @@ namespace RTC
if
(
this
->
lastSrReceived
!=
0
)
if
(
this
->
lastSrReceived
!=
0
)
{
{
// Get delay in milliseconds.
// Get delay in milliseconds.
auto
delayMs
=
static_cast
<
uint32_t
>
(
DepLibUV
::
GetTimeMs
()
-
this
->
lastSrReceived
)
;
const
uint32_t
delayMs
=
DepLibUV
::
GetTimeMs
()
-
this
->
lastSrReceived
;
// Express delay in units of 1/65536 seconds.
// Express delay in units of 1/65536 seconds.
uint32_t
dlsr
=
(
delayMs
/
1000
)
<<
16
;
uint32_t
dlsr
=
(
delayMs
/
1000
)
<<
16
;
...
...
worker/src/RTC/TransportCongestionControlServer.cpp
浏览文件 @
03110738
...
@@ -338,7 +338,7 @@ namespace RTC
...
@@ -338,7 +338,7 @@ namespace RTC
// the condition is met.
// the condition is met.
if
(
nowMs
>=
PacketArrivalTimestampWindow
)
if
(
nowMs
>=
PacketArrivalTimestampWindow
)
{
{
auto
expiryTimestamp
=
nowMs
-
PacketArrivalTimestampWindow
;
uint64_t
expiryTimestamp
=
nowMs
-
PacketArrivalTimestampWindow
;
auto
it
=
this
->
mapPacketArrivalTimes
.
begin
();
auto
it
=
this
->
mapPacketArrivalTimes
.
begin
();
while
(
it
!=
this
->
mapPacketArrivalTimes
.
end
()
&&
while
(
it
!=
this
->
mapPacketArrivalTimes
.
end
()
&&
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论