mirror of
https://git.jami.net/savoirfairelinux/jami-daemon.git
synced 2025-08-12 22:09:25 +08:00
video_rtp_session: prevent nullptr dereference
Also removes log message. Change-Id: I5fc4dff440641f604f7f522d8319523715f4ef89
This commit is contained in:

committed by
Adrien Béraud

parent
197e3adf63
commit
a538de38da
@ -419,10 +419,9 @@ VideoRtpSession::adaptQualityAndBitrate()
|
||||
//Take action only when two successive drop superior to 5% are catched...
|
||||
//and when jitter is less than 1 seconds
|
||||
auto pondLoss = getPonderateLoss(rtcpi.packetLoss);
|
||||
JAMI_DBG("[AutoAdapt] Pondloss: %f%, last loss: %f%", pondLoss, rtcpi.packetLoss);
|
||||
if(pondLoss >= 5.0f)
|
||||
{
|
||||
videoBitrateInfo_.videoBitrateCurrent = videoBitrateInfo_.videoBitrateCurrent * (1.0f - rtcpi.packetLoss/200.0f);
|
||||
//JAMI_DBG("[AutoAdapt] Pondloss: %f%%, last loss: %f%%", pondLoss, rtcpi.packetLoss);
|
||||
if(pondLoss >= 5.0f) {
|
||||
videoBitrateInfo_.videoBitrateCurrent = videoBitrateInfo_.videoBitrateCurrent * (1.0f - rtcpi.packetLoss/200.0f);
|
||||
JAMI_DBG("[AutoAdapt] pondLoss: %f%%, packet loss rate: %f%%, decrease bitrate from %d Kbps to %d Kbps, ratio %f", pondLoss, rtcpi.packetLoss, oldBitrate, videoBitrateInfo_.videoBitrateCurrent, (float) videoBitrateInfo_.videoBitrateCurrent / oldBitrate);
|
||||
histoLoss_.clear();
|
||||
}
|
||||
@ -434,7 +433,7 @@ VideoRtpSession::adaptQualityAndBitrate()
|
||||
storeVideoBitrateInfo();
|
||||
|
||||
// If encoder no longer exist do nothing
|
||||
if(sender_->setBitrate(videoBitrateInfo_.videoBitrateCurrent) == 0)
|
||||
if(sender_ && sender_->setBitrate(videoBitrateInfo_.videoBitrateCurrent) == 0)
|
||||
lastMediaRestart_ = now;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user