From 0e0dc5c5be4a93b05518668b4487d8bc8c16cae1 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 16 Oct 2014 01:03:02 +0200 Subject: player: fix crash on early audio uninit Could crash when exiting playback in very early stages of initialization. CC: @mpv-player/stable --- player/audio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/player/audio.c b/player/audio.c index e5cdd671e5..50b2de9724 100644 --- a/player/audio.c +++ b/player/audio.c @@ -593,8 +593,8 @@ void fill_audio_out_buffers(struct MPContext *mpctx, double endpts) // Drop data queued for output, or which the AO is currently outputting. void clear_audio_output_buffers(struct MPContext *mpctx) { - if (mpctx->ao) { + if (mpctx->ao) ao_reset(mpctx->ao); + if (mpctx->ao_buffer) mp_audio_buffer_clear(mpctx->ao_buffer); - } } -- cgit v1.2.3