aboutsummaryrefslogtreecommitdiff
path: root/api/video_codecs/video_encoder.cc
diff options
context:
space:
mode:
Diffstat (limited to 'api/video_codecs/video_encoder.cc')
-rw-r--r--api/video_codecs/video_encoder.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/api/video_codecs/video_encoder.cc b/api/video_codecs/video_encoder.cc
index 486200bc82..a7e9d7487c 100644
--- a/api/video_codecs/video_encoder.cc
+++ b/api/video_codecs/video_encoder.cc
@@ -135,8 +135,17 @@ std::string VideoEncoder::EncoderInfo::ToString() const {
<< ", is_hardware_accelerated = " << is_hardware_accelerated
<< ", has_internal_source = " << has_internal_source
<< ", fps_allocation = [";
+ size_t num_spatial_layer_with_fps_allocation = 0;
+ for (size_t i = 0; i < kMaxSpatialLayers; ++i) {
+ if (!fps_allocation[i].empty()) {
+ num_spatial_layer_with_fps_allocation = i + 1;
+ }
+ }
bool first = true;
- for (size_t i = 0; i < fps_allocation->size(); ++i) {
+ for (size_t i = 0; i < num_spatial_layer_with_fps_allocation; ++i) {
+ if (fps_allocation[i].empty()) {
+ break;
+ }
if (!first) {
oss << ", ";
}