| Index: webrtc/media/engine/webrtcvideoengine2.cc
|
| diff --git a/webrtc/media/engine/webrtcvideoengine2.cc b/webrtc/media/engine/webrtcvideoengine2.cc
|
| index c192b52402ee95ef3f2ffd9dbe25f65ded5ecf6d..02063954921b28a228a7de8a6dbc576c042a9154 100644
|
| --- a/webrtc/media/engine/webrtcvideoengine2.cc
|
| +++ b/webrtc/media/engine/webrtcvideoengine2.cc
|
| @@ -1612,7 +1612,15 @@ bool WebRtcVideoChannel2::WebRtcVideoSendStream::SetVideoSend(
|
| if (options_present) {
|
| VideoOptions old_options = parameters_.options;
|
| parameters_.options.SetAll(*options);
|
| - if (parameters_.options != old_options) {
|
| + if (parameters_.options.is_screencast.value_or(false) !=
|
| + old_options.is_screencast.value_or(false) &&
|
| + parameters_.codec_settings) {
|
| + // If screen content settings change, we may need to recreate the codec
|
| + // instance so that the correct type is used. Add a param to force the
|
| + // SetCodec() to not resuse the current instance.
|
| + allocated_encoder_.codec.params["recreate"] = "true";
|
| + SetCodec(*parameters_.codec_settings);
|
| + } else if (parameters_.options != old_options) {
|
| ReconfigureEncoder();
|
| }
|
| }
|
|
|