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:
pbos
2015-07-01 06:31:06 -07:00
committed by Commit bot
parent bd2522abf7
commit 545727ecce

View File

@ -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);