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

SimulcastConsumer::IncreaseLayer(): return if no producerRtpStreams was selected (fixes #300)

上级 12678727
...@@ -76,7 +76,8 @@ namespace RTC ...@@ -76,7 +76,8 @@ namespace RTC
this->preferredTemporalLayer = encoding.temporalLayers - 1; this->preferredTemporalLayer = encoding.temporalLayers - 1;
} }
// Reserve space for the Producer RTP streams. // Reserve space for the Producer RTP streams by filling all the possible
// entries with nullptr.
this->producerRtpStreams.insert( this->producerRtpStreams.insert(
this->producerRtpStreams.begin(), this->consumableRtpEncodings.size(), nullptr); this->producerRtpStreams.begin(), this->consumableRtpEncodings.size(), nullptr);
...@@ -500,6 +501,7 @@ namespace RTC ...@@ -500,6 +501,7 @@ namespace RTC
// Can upgrade spatial layer. // Can upgrade spatial layer.
else if (static_cast<size_t>(spatialLayer) < this->producerRtpStreams.size() - 1) else if (static_cast<size_t>(spatialLayer) < this->producerRtpStreams.size() - 1)
{ {
// This could be null.
producerRtpStream = this->producerRtpStreams.at(++spatialLayer); producerRtpStream = this->producerRtpStreams.at(++spatialLayer);
// Producer stream does not exist or it's not good. Exit. // Producer stream does not exist or it's not good. Exit.
...@@ -509,6 +511,11 @@ namespace RTC ...@@ -509,6 +511,11 @@ namespace RTC
// Set temporal layer to 0. // Set temporal layer to 0.
temporalLayer = 0; temporalLayer = 0;
} }
// Otherwise we cannot change anything.
else
{
return 0;
}
auto now = DepLibUV::GetTime(); auto now = DepLibUV::GetTime();
auto requiredBitrate = producerRtpStream->GetLayerBitrate(now, 0, temporalLayer); auto requiredBitrate = producerRtpStream->GetLayerBitrate(now, 0, temporalLayer);
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论