Unverified 提交 a24f0ec2 authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo 提交者: GitHub

Fix frozen video due to double call to Consumer::UserOnTransportDisconnected() (#788)

Rationale given here: https://github.com/versatica/mediasoup/pull/787#issuecomment-1060891193

We always check flags and return fast if the flag was already set (or unset, it depends), then we set or unset the flag and run code. Here we failed and didn't honor this pattern.
上级 169b05b6
...@@ -373,6 +373,9 @@ namespace RTC ...@@ -373,6 +373,9 @@ namespace RTC
{ {
MS_TRACE(); MS_TRACE();
if (this->transportConnected)
return;
this->transportConnected = true; this->transportConnected = true;
MS_DEBUG_DEV("Transport connected [consumerId:%s]", this->id.c_str()); MS_DEBUG_DEV("Transport connected [consumerId:%s]", this->id.c_str());
...@@ -384,6 +387,9 @@ namespace RTC ...@@ -384,6 +387,9 @@ namespace RTC
{ {
MS_TRACE(); MS_TRACE();
if (!this->transportConnected)
return;
this->transportConnected = false; this->transportConnected = false;
MS_DEBUG_DEV("Transport disconnected [consumerId:%s]", this->id.c_str()); MS_DEBUG_DEV("Transport disconnected [consumerId:%s]", this->id.c_str());
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论