From f16b1cdc17f7a887d1a31609e1997afd5d5c0845 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 c9ea462f81..fffbcf78a9 100644 --- a/player/audio.c +++ b/player/audio.c @@ -520,8 +520,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