Move early-return in TimeToSendPadding.
Prevents taking send_critsect_ for checking sending status when not actually intending to send padding. BUG= R=stefan@webrtc.org Review URL: https://codereview.webrtc.org/1218093002 Cr-Commit-Position: refs/heads/master@{#9526}
This commit is contained in:
@ -958,12 +958,12 @@ bool RTPSender::IsFecPacket(const uint8_t* buffer,
|
||||
}
|
||||
|
||||
size_t RTPSender::TimeToSendPadding(size_t bytes) {
|
||||
if (bytes == 0)
|
||||
return 0;
|
||||
{
|
||||
CriticalSectionScoped cs(send_critsect_.get());
|
||||
if (!sending_media_) return 0;
|
||||
}
|
||||
if (bytes == 0)
|
||||
return 0;
|
||||
size_t bytes_sent = TrySendRedundantPayloads(bytes);
|
||||
if (bytes_sent < bytes)
|
||||
bytes_sent += TrySendPadData(bytes - bytes_sent);
|
||||
|
Reference in New Issue
Block a user