Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1088)

Unified Diff: webrtc/video/video_receive_stream.cc

Issue 2720963003: Avoid busy looping as the VideoReceiveStream is shut down. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/video/video_receive_stream.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video/video_receive_stream.cc
diff --git a/webrtc/video/video_receive_stream.cc b/webrtc/video/video_receive_stream.cc
index b4b924367955f71a4799dec055868b405eddb78a..fbfdb2b67fc7df9d063945e8c9294f0dec461990 100644
--- a/webrtc/video/video_receive_stream.cc
+++ b/webrtc/video/video_receive_stream.cc
@@ -468,18 +468,17 @@ void VideoReceiveStream::SetMinimumPlayoutDelay(int delay_ms) {
}
bool VideoReceiveStream::DecodeThreadFunction(void* ptr) {
- static_cast<VideoReceiveStream*>(ptr)->Decode();
- return true;
+ return static_cast<VideoReceiveStream*>(ptr)->Decode();
}
-void VideoReceiveStream::Decode() {
+bool VideoReceiveStream::Decode() {
static const int kMaxWaitForFrameMs = 3000;
std::unique_ptr<video_coding::FrameObject> frame;
video_coding::FrameBuffer::ReturnReason res =
frame_buffer_->NextFrame(kMaxWaitForFrameMs, &frame);
if (res == video_coding::FrameBuffer::ReturnReason::kStopped)
- return;
+ return false;
if (frame) {
if (video_receiver_.Decode(frame.get()) == VCM_OK)
@@ -489,6 +488,7 @@ void VideoReceiveStream::Decode() {
<< " ms, requesting keyframe.";
RequestKeyFrame();
}
+ return true;
}
} // namespace internal
} // namespace webrtc
« no previous file with comments | « webrtc/video/video_receive_stream.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698