diff options
author | wm4 <wm4@nowhere> | 2014-10-16 01:03:02 +0200 |
---|---|---|
committer | Alessandro Ghedini <alessandro@ghedini.me> | 2014-10-16 13:13:26 +0200 |
commit | f16b1cdc17f7a887d1a31609e1997afd5d5c0845 (patch) | |
tree | 0aff81bad0beb7a9163a6fc08428c9c9b19642a8 | |
parent | f2e289dc8062a52b3dd3070f2a24b1418d57a117 (diff) | |
download | mpv-f16b1cdc17f7a887d1a31609e1997afd5d5c0845.tar.bz2 mpv-f16b1cdc17f7a887d1a31609e1997afd5d5c0845.tar.xz |
player: fix crash on early audio uninit
Could crash when exiting playback in very early stages of
initialization.
CC: @mpv-player/stable
-rw-r--r-- | player/audio.c | 4 |
1 files 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); - } } |