Chromium Code Reviews| Index: webrtc/modules/video_coding/codecs/vp8/screenshare_layers.cc |
| diff --git a/webrtc/modules/video_coding/codecs/vp8/screenshare_layers.cc b/webrtc/modules/video_coding/codecs/vp8/screenshare_layers.cc |
| index 536587a13ee07795f7bacab1c2eec4fbe41ffa27..282268a087eb0afeb6e4868e149bd68337ad44b4 100644 |
| --- a/webrtc/modules/video_coding/codecs/vp8/screenshare_layers.cc |
| +++ b/webrtc/modules/video_coding/codecs/vp8/screenshare_layers.cc |
| @@ -147,7 +147,8 @@ bool ScreenshareLayers::ConfigureBitrates(int bitrate_kbps, |
| } |
| // Don't reconfigure qp limits during quality boost frames. |
| - if (layers_[active_layer_].state != TemporalLayer::State::kQualityBoost) { |
| + if (active_layer_ != -1 && |
|
pbos-webrtc
2016/02/02 21:16:14
Can you amend the comment above to include what -1
sprang
2016/02/03 10:05:37
Done.
|
| + layers_[active_layer_].state != TemporalLayer::State::kQualityBoost) { |
| min_qp_ = cfg->rc_min_quantizer; |
| max_qp_ = cfg->rc_max_quantizer; |
| // After a dropped frame, a frame with max qp will be encoded and the |
| @@ -169,6 +170,7 @@ bool ScreenshareLayers::ConfigureBitrates(int bitrate_kbps, |
| void ScreenshareLayers::FrameEncoded(unsigned int size, |
| uint32_t timestamp, |
| int qp) { |
| + RTC_DCHECK_NE(-1, active_layer_); |
| if (size == 0) { |
| layers_[active_layer_].state = TemporalLayer::State::kDropped; |
| return; |
| @@ -198,6 +200,7 @@ void ScreenshareLayers::PopulateCodecSpecific(bool base_layer_sync, |
| vp8_info->layerSync = false; |
| vp8_info->tl0PicIdx = kNoTl0PicIdx; |
| } else { |
| + RTC_DCHECK_NE(-1, active_layer_); |
| vp8_info->temporalIdx = active_layer_; |
| if (base_layer_sync) { |
| vp8_info->temporalIdx = 0; |
| @@ -248,6 +251,7 @@ bool ScreenshareLayers::TimeToSync(int64_t timestamp) const { |
| bool ScreenshareLayers::UpdateConfiguration(vpx_codec_enc_cfg_t* cfg) { |
| if (max_qp_ == -1 || number_of_temporal_layers_ <= 1) |
| return false; |
| + RTC_DCHECK_NE(-1, active_layer_); |
| // If layer is in the quality boost state (following a dropped frame), update |
| // the configuration with the adjusted (lower) qp and set the state back to |