summaryrefslogtreecommitdiffstats
path: root/player/audio.c
diff options
context:
space:
mode:
authorTom Wilson <twilson90@hotmail.co.uk>2021-02-17 11:04:07 +0000
committersfan5 <sfan5@live.de>2021-03-15 01:06:10 +0100
commite79e455a360381a4db1b790a63d4bb3131a9dabc (patch)
tree77891a7c453f3ecd7a9e5571b1ecb10e14f2791e /player/audio.c
parent6a903a9a087e9639eb3323a7e5adeb49871011af (diff)
downloadmpv-e79e455a360381a4db1b790a63d4bb3131a9dabc.tar.bz2
mpv-e79e455a360381a4db1b790a63d4bb3131a9dabc.tar.xz
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
Diffstat (limited to 'player/audio.c')
-rw-r--r--player/audio.c3
1 files changed, 2 insertions, 1 deletions
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;
}