From e79e455a360381a4db1b790a63d4bb3131a9dabc Mon Sep 17 00:00:00 2001 From: Tom Wilson Date: Wed, 17 Feb 2021 11:04:07 +0000 Subject: 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 --- player/audio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'player/audio.c') diff --git a/player/audio.c b/player/audio.c index 50c0faaf09..bf35bfb02a 100644 --- a/player/audio.c +++ b/player/audio.c @@ -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; } -- cgit v1.2.3