From 1e96f5bcd98f41fa11d87f1a5236468f985327a9 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 27 Nov 2013 20:54:29 +0100 Subject: Move some code from player to audio/video reset functions --- audio/decode/dec_audio.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'audio/decode/dec_audio.c') diff --git a/audio/decode/dec_audio.c b/audio/decode/dec_audio.c index 26452b702e..8cd7783069 100644 --- a/audio/decode/dec_audio.c +++ b/audio/decode/dec_audio.c @@ -349,8 +349,12 @@ int audio_decode(struct dec_audio *d_audio, struct mp_audio_buffer *outbuf, void audio_reset_decoding(struct dec_audio *d_audio) { - d_audio->pts = MP_NOPTS_VALUE; - d_audio->pts_offset = 0; if (d_audio->ad_driver) d_audio->ad_driver->control(d_audio, ADCTRL_RESET, NULL); + if (d_audio->afilter) + af_control_all(d_audio->afilter, AF_CONTROL_RESET, NULL); + d_audio->pts = MP_NOPTS_VALUE; + d_audio->pts_offset = 0; + if (d_audio->decode_buffer) + mp_audio_buffer_clear(d_audio->decode_buffer); } -- cgit v1.2.3