Index: webrtc/modules/video_coding/video_sender.cc |
diff --git a/webrtc/modules/video_coding/video_sender.cc b/webrtc/modules/video_coding/video_sender.cc |
index c202d34e859819dabad29201dba1bef82b46d28d..b95d402323aa13aa6280b7534a54a5a732681127 100644 |
--- a/webrtc/modules/video_coding/video_sender.cc |
+++ b/webrtc/modules/video_coding/video_sender.cc |
@@ -33,11 +33,12 @@ VideoSender::VideoSender(Clock* clock, |
: clock_(clock), |
_encoder(nullptr), |
_mediaOpt(clock_), |
+ has_received_frame_(false), |
_encodedFrameCallback(post_encode_callback, &_mediaOpt), |
send_stats_callback_(send_stats_callback), |
_codecDataBase(&_encodedFrameCallback), |
frame_dropper_enabled_(true), |
- _sendStatsTimer(1000, clock_), |
+ _sendStatsTimer(VCMProcessTimer::kDefaultProcessIntervalMs, clock_), |
current_codec_(), |
encoder_params_({BitrateAllocation(), 0, 0, 0}), |
encoder_has_internal_source_(false), |
@@ -139,6 +140,7 @@ int32_t VideoSender::RegisterSendCodec(const VideoCodec* sendCodec, |
sendCodec->startBitrate * 1000, sendCodec->width, |
sendCodec->height, sendCodec->maxFramerate, |
numLayers, maxPayloadSize); |
+ has_received_frame_ = false; |
return VCM_OK; |
} |
@@ -199,6 +201,12 @@ EncoderParameters VideoSender::UpdateEncoderParameters( |
uint32_t video_target_rate_bps = _mediaOpt.SetTargetRates( |
target_bitrate_bps, params.loss_rate, params.rtt); |
uint32_t input_frame_rate = _mediaOpt.InputFrameRate(); |
+ if (input_frame_rate > 0) { |
+ has_received_frame_ = true; |
+ } else if (input_frame_rate == 0 && !has_received_frame_) { |
+ input_frame_rate = current_codec_.maxFramerate; |
+ } |
+ |
BitrateAllocation bitrate_allocation; |
if (bitrate_allocator) { |
bitrate_allocation = bitrate_allocator->GetAllocation(video_target_rate_bps, |