Ilya Nikolaevskiy 5d56b7cdf0 SimulcastEncoderAdapter: ensure registered callback isn't lost
Currently, if the single-encoder mode fails to initialize, the
callback is cleared on the encoder with Release() call.

Below, the encoder_context for the first stream will be reused but
then we only intercept the callback for the stream_idx>0.

Therefore if RegisterEncodeCompleteCallback() is called before the InitEncode(), the first stream will end up with nullptr callback.

To ensure this doesn't happen, restore the callback on the reusable encoder.

Bug: none
Change-Id: I1c830f3bf71f64807d5cc1a3000b73834011bde4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/356180
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42580}
2024-07-03 08:38:04 +00:00
..