aboutsummaryrefslogtreecommitdiffstats
path: root/libswresample/dither.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-04-28 11:19:22 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-04-28 13:02:58 +0200
commitedbde5222688c18eecd7a589779aa8696b64a6ab (patch)
tree28405bcbcb939665b6e8e2b0efbb160f66168239 /libswresample/dither.c
parent9d4a1aca883965cfc2bbc5a6f9c9d8f4b93f9d74 (diff)
downloadffmpeg-edbde5222688c18eecd7a589779aa8696b64a6ab.tar.gz
swr: change sample format representation so as to maintain the planer/packed distinction.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswresample/dither.c')
-rw-r--r--libswresample/dither.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libswresample/dither.c b/libswresample/dither.c
index a340733610..79113f4c23 100644
--- a/libswresample/dither.c
+++ b/libswresample/dither.c
@@ -27,6 +27,9 @@ void swri_get_dither(SwrContext *s, void *dst, int len, unsigned seed, enum AVSa
double *tmp = av_malloc((len + TMP_EXTRA) * sizeof(double));
int i;
+ out_fmt = av_get_packed_sample_fmt(out_fmt);
+ in_fmt = av_get_packed_sample_fmt( in_fmt);
+
if(in_fmt == AV_SAMPLE_FMT_FLT || in_fmt == AV_SAMPLE_FMT_DBL){
if(out_fmt == AV_SAMPLE_FMT_S32) scale = 1.0/(1L<<31);
if(out_fmt == AV_SAMPLE_FMT_S16) scale = 1.0/(1L<<15);