diff options
author | Paul B Mahol <onemda@gmail.com> | 2016-08-19 20:18:48 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-08-20 11:37:06 +0200 |
commit | e0576294934bd35f44d57f8033909ab515f19b83 (patch) | |
tree | 26540814852239e6a6de4c0732c72f78094a13d5 /audio | |
parent | cb31e72589280f377bb3c6d6d4b41672bdecae80 (diff) | |
download | mpv-e0576294934bd35f44d57f8033909ab515f19b83.tar.bz2 mpv-e0576294934bd35f44d57f8033909ab515f19b83.tar.xz |
af_lavrresample: better swr reinitialization
Diffstat (limited to 'audio')
-rw-r--r-- | audio/filter/af_lavrresample.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/audio/filter/af_lavrresample.c b/audio/filter/af_lavrresample.c index 7c704c22e8..dc5d1a0d23 100644 --- a/audio/filter/af_lavrresample.c +++ b/audio/filter/af_lavrresample.c @@ -400,10 +400,11 @@ static int control(struct af_instance *af, int cmd, void *arg) case AF_CONTROL_RESET: if (s->avrctx) { #if HAVE_LIBSWRESAMPLE - // This POS either can't drop state correctly, or doesn't want to. - // It will swallow some minor audio e.g. after a seek. - // Deallocate and recreate the resample state for a full reset. - configure_lavrr(af, &af->fmt_in, &af->fmt_out, false); + swr_close(s->avrctx); + if (swr_init(s->avrctx) < 0) { + close_lavrr(af); + return AF_ERROR; + } #else while (avresample_read(s->avrctx, NULL, 1000) > 0) {} #endif |