diff options
author | wm4 <wm4@nowhere> | 2013-11-08 20:02:09 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-11-08 20:29:26 +0100 |
commit | 6354a6b07dd3e0aee23e71ee2574754d620bdd09 (patch) | |
tree | 2cd4137ddec69890434273774d4571786668e9e2 /mpvcore/player/loadfile.c | |
parent | 8125252399d9b02a6f143d109a92341ff7eff5a9 (diff) | |
download | mpv-6354a6b07dd3e0aee23e71ee2574754d620bdd09.tar.bz2 mpv-6354a6b07dd3e0aee23e71ee2574754d620bdd09.tar.xz |
player: factor audio buffer clearing code
Note that the change in seek_reset is not entirely equivalent: we even
drop the remainder of buffered audio when seeking. This should be more
correct, because the whole point of the reset_ao parameter is to control
whether audio queued for output should be dropped or not.
Diffstat (limited to 'mpvcore/player/loadfile.c')
-rw-r--r-- | mpvcore/player/loadfile.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/mpvcore/player/loadfile.c b/mpvcore/player/loadfile.c index 569532840c..a35da703ed 100644 --- a/mpvcore/player/loadfile.c +++ b/mpvcore/player/loadfile.c @@ -1292,12 +1292,8 @@ terminate_playback: // don't jump here after ao/vo/getch initialization! if (mpctx->stop_play == KEEP_PLAYING) mpctx->stop_play = AT_END_OF_FILE; - // Drop audio left in the buffers - if (mpctx->stop_play != AT_END_OF_FILE && mpctx->ao) { - mpctx->ao->buffer_playable_size = 0; - mpctx->ao->buffer.len = 0; - ao_reset(mpctx->ao); - } + if (mpctx->stop_play != AT_END_OF_FILE) + clear_audio_output_buffers(mpctx); if (opts->position_save_on_quit && mpctx->stop_play == PT_QUIT) mp_write_watch_later_conf(mpctx); |