summaryrefslogtreecommitdiff
path: root/libswresample
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-01-08 16:55:46 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-01-08 20:07:16 +0100
commit9aec63af9b50af1d809d31389d67e98c2c688133 (patch)
tree13a246e58d16980b00e0ba7d539e182767b4a202 /libswresample
parent252316c88598420df1120696f46a532a5ae502a4 (diff)
swr: fix assertion failure if dither is used without the preout buffer differing from in
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswresample')
-rw-r--r--libswresample/swresample.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libswresample/swresample.c b/libswresample/swresample.c
index f01927f293..c4a647ce04 100644
--- a/libswresample/swresample.c
+++ b/libswresample/swresample.c
@@ -602,6 +602,11 @@ static int swr_convert_internal(struct SwrContext *s, AudioData *out, int out_co
if(s->resample_first ? !s->rematrix : !s->resample)
preout= midbuf;
+ if (preout == in && s->dither_method) {
+ av_assert1(postin == midbuf && midbuf == preout);
+ postin = midbuf = preout = &preout_tmp;
+ }
+
if(s->int_sample_fmt == s->out_sample_fmt && s->out.planar){
if(preout==in){
out_count= FFMIN(out_count, in_count); //TODO check at the end if this is needed or redundant