Properly propagate error in WebRtcVideoSendStream::SetRtpParameters

When an error occurs, the callback needs to be invoked or the
signaling thread may block indefinitely waiting for it.

Bug: webrtc:15871
Change-Id: Ib73382aff07b3632794300985223c70c24f554f4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/342901
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41904}
This commit is contained in:
karllen.zheng@ringcentral.com 2024-03-14 16:51:02 +08:00 committed by WebRTC LUCI CQ
parent 776c1a1a86
commit 2af888e414

View File

@ -1966,8 +1966,7 @@ WebRtcVideoSendChannel::WebRtcVideoSendStream::SetRtpParameters(
webrtc::RTCError error = CheckRtpParametersInvalidModificationAndValues(
rtp_parameters_, new_parameters);
if (!error.ok()) {
// Error is propagated to the callback at a higher level
return error;
return webrtc::InvokeSetParametersCallback(callback, error);
}
bool new_param = false;