Add a missing lock in VideoBroadcaster::OnDiscardedFrame().
VideoBroadcaster is marked as thread-safe, but that is currently not the case as OnDiscardedFrame() iterates through an std::vector of sinks in VideoSourceBase that is not thread-safe and elements of that std::vector are added/removed in AddOrUpdateSink()/RemoveSink() that could be called on a different thread. Bug: None Change-Id: I5b61127f7ea6ce7f1322c5e770ab56643d7bd0d3 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/208404 Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org> Commit-Queue: Mirta Dvornicic <mirtad@webrtc.org> Cr-Commit-Position: refs/heads/master@{#33313}
This commit is contained in:
parent
2bfddf78d2
commit
8ef1d7b1f9
@ -94,6 +94,7 @@ void VideoBroadcaster::OnFrame(const webrtc::VideoFrame& frame) {
|
||||
}
|
||||
|
||||
void VideoBroadcaster::OnDiscardedFrame() {
|
||||
webrtc::MutexLock lock(&sinks_and_wants_lock_);
|
||||
for (auto& sink_pair : sink_pairs()) {
|
||||
sink_pair.sink->OnDiscardedFrame();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user