summaryrefslogtreecommitdiff
path: root/libswresample/dither.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-01-10 18:51:30 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-01-10 18:51:30 +0100
commite5a736261bafb1bc5a4c51d614be63e0632b2e96 (patch)
tree5c9407a8853270b262100d85943105dfe5c6f330 /libswresample/dither.c
parent2eec98125eadf47d81332014734569f7c1daeb60 (diff)
swr: Use a temporary buffer for dither/Noise shaping when the input is read only
This avoids copying the input Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswresample/dither.c')
-rw-r--r--libswresample/dither.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libswresample/dither.c b/libswresample/dither.c
index d7a5b6b558..ae56c8c3ee 100644
--- a/libswresample/dither.c
+++ b/libswresample/dither.c
@@ -115,7 +115,9 @@ int swri_dither_init(SwrContext *s, enum AVSampleFormat out_fmt, enum AVSampleFo
s->dither.method = SWR_DITHER_TRIANGULAR_HIGHPASS;
}
+ av_assert0(!s->preout.count);
s->dither.noise = s->preout;
+ s->dither.temp = s->preout;
if (s->dither.method > SWR_DITHER_NS) {
s->dither.noise.bps = 4;
s->dither.noise.fmt = AV_SAMPLE_FMT_FLTP;