Return early from VP9EncoderImpl::Encode() if all layers inactive

Bug: chromium:927027
Change-Id: Ib3eab2ca782619b2b2a595f67db630b009c3ffba
Reviewed-on: https://webrtc-review.googlesource.com/c/121407
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26534}
This commit is contained in:
Erik Språng
2019-02-04 16:40:19 +01:00
committed by Commit Bot
parent 8573aae7d0
commit bfa5d5d9aa

View File

@ -721,6 +721,10 @@ int VP9EncoderImpl::Encode(const VideoFrame& input_image,
if (encoded_complete_callback_ == nullptr) {
return WEBRTC_VIDEO_CODEC_UNINITIALIZED;
}
if (num_active_spatial_layers_ == 0) {
// All spatial layers are disabled, return without encoding anything.
return WEBRTC_VIDEO_CODEC_OK;
}
// We only support one stream at the moment.
if (frame_types && !frame_types->empty()) {