audio: prevent uninit_audio_out during encoding

There was a simple oversight that meant audio outputs were
uninitialized during an encoding, which is not allowed, the encoding
would stop with numerous errors.
I added a single line to prevent the call of uninit_audio_out in
reinit_audio_chain if the encoder was active and this appears to have
fixed the problem without breaking anything else.

Fixes #8568
This commit is contained in:
Tom Wilson 2021-02-17 11:04:07 +00:00 committed by sfan5
parent 6a903a9a08
commit e79e455a36
1 changed files with 2 additions and 1 deletions

View File

@ -516,7 +516,8 @@ void reinit_audio_chain(struct MPContext *mpctx)
struct track *track = NULL;
track = mpctx->current_track[0][STREAM_AUDIO];
if (!track || !track->stream) {
uninit_audio_out(mpctx);
if (!mpctx->encode_lavc_ctx)
uninit_audio_out(mpctx);
error_on_track(mpctx, track);
return;
}