video: fix screen sharing on macOS

Because media encoder flush() involves encoding we should change
initialized flag after calling flush(), otherwise, it could lead to
new stream initializing.

https://git.jami.net/savoirfairelinux/jami-client-macos/-/issues/299

Change-Id: I88d5648a6f252bd78776f505f891f09a4e5b12e1
This commit is contained in:
kkostiuk
2021-12-15 08:56:40 -05:00
committed by Kateryna Kostiuk
parent 9c9d11e410
commit 41eab75d73

View File

@ -1340,13 +1340,12 @@ MediaEncoder::getScaledSWFrame(const VideoFrame& input)
void
MediaEncoder::resetStreams(int width, int height)
{
// Only called by VideoSender!
initialized_ = false;
videoOpts_.width = width;
videoOpts_.height = height;
try {
flush();
initialized_ = false;
if (outputCtx_) {
for (auto encoderCtx : encoders_) {
if (encoderCtx) {