Wait for keyframe after decoding error.
Bug: chromium:936715
Change-Id: I0a51c8fa0025cb0f8e9afcbe8d8e4a84c2709ecf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/134960
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27827}
diff --git a/modules/video_coding/frame_buffer2.cc b/modules/video_coding/frame_buffer2.cc
index 9b2b907..000152f 100644
--- a/modules/video_coding/frame_buffer2.cc
+++ b/modules/video_coding/frame_buffer2.cc
@@ -153,7 +153,8 @@
// means that the frame buffer was cleared as the thread in this function
// was waiting to acquire |crit_| in order to return. Wait for the
// remaining time and then return.
- return NextFrame(latest_return_time_ms - now_ms, frame_out);
+ return NextFrame(latest_return_time_ms - now_ms, frame_out,
+ keyframe_required);
}
return kTimeout;
}
diff --git a/modules/video_coding/frame_buffer2.h b/modules/video_coding/frame_buffer2.h
index cffdf3e..835079c 100644
--- a/modules/video_coding/frame_buffer2.h
+++ b/modules/video_coding/frame_buffer2.h
@@ -65,7 +65,7 @@
// - If the FrameBuffer is stopped then it will return kStopped.
ReturnReason NextFrame(int64_t max_wait_time_ms,
std::unique_ptr<EncodedFrame>* frame_out,
- bool keyframe_required = false);
+ bool keyframe_required);
void NextFrame(
int64_t max_wait_time_ms,
bool keyframe_required,
diff --git a/modules/video_coding/frame_buffer2_unittest.cc b/modules/video_coding/frame_buffer2_unittest.cc
index d36707b..f1308ac 100644
--- a/modules/video_coding/frame_buffer2_unittest.cc
+++ b/modules/video_coding/frame_buffer2_unittest.cc
@@ -251,7 +251,7 @@
std::unique_ptr<EncodedFrame> frame;
FrameBuffer::ReturnReason res =
- tfb->buffer_->NextFrame(tfb->max_wait_time_, &frame);
+ tfb->buffer_->NextFrame(tfb->max_wait_time_, &frame, false);
if (res != FrameBuffer::ReturnReason::kStopped)
tfb->frames_.emplace_back(std::move(frame));
}