Fix crash when setting duplicate receive codecs.
Instead of crashing, log a warning. Bug: chromium:810173 Change-Id: I7e43889fdab429fcb231657f5770b0ff26f34a8f Reviewed-on: https://webrtc-review.googlesource.com/59020 Reviewed-by: Magnus Jedvert <magjed@webrtc.org> Commit-Queue: Anders Carlsson <andersc@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22322}
This commit is contained in:
committed by
Commit Bot
parent
69d2dc94d3
commit
7dbb701076
@ -2211,6 +2211,13 @@ void WebRtcVideoChannel::WebRtcVideoReceiveStream::ConfigureCodecs(
|
||||
recv_codec.codec.params);
|
||||
std::unique_ptr<webrtc::VideoDecoder> new_decoder;
|
||||
|
||||
if (allocated_decoders_.count(video_format) > 0) {
|
||||
RTC_LOG(LS_WARNING)
|
||||
<< "VideoReceiveStream configured with duplicate codecs: "
|
||||
<< video_format.name;
|
||||
continue;
|
||||
}
|
||||
|
||||
auto it = old_decoders->find(video_format);
|
||||
if (it != old_decoders->end()) {
|
||||
new_decoder = std::move(it->second);
|
||||
|
||||
Reference in New Issue
Block a user