aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/adpcmenc.c
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2012-10-07 16:02:20 -0400
committerMichael Niedermayer <michaelni@gmx.at>2012-10-07 22:29:42 +0200
commitd58b25aaa261040cec29bffa571c41bc9f652f10 (patch)
tree7b885ac1ad7332fa963686d98cf4ef8353651957 /libavcodec/adpcmenc.c
parent27a341518e91ca18cbee292725a74a3c23a0d272 (diff)
downloadandroid_external_ffmpeg-d58b25aaa261040cec29bffa571c41bc9f652f10.tar.gz
android_external_ffmpeg-d58b25aaa261040cec29bffa571c41bc9f652f10.tar.bz2
android_external_ffmpeg-d58b25aaa261040cec29bffa571c41bc9f652f10.zip
adpcmenc: ensure calls to adpcm_ima_compress_sample() are in the right order
Should fix fate-acodec-adpcm-ima_wav with several compilers. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/adpcmenc.c')
-rw-r--r--libavcodec/adpcmenc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/adpcmenc.c b/libavcodec/adpcmenc.c
index f016ebd910..747b9fe4c4 100644
--- a/libavcodec/adpcmenc.c
+++ b/libavcodec/adpcmenc.c
@@ -538,8 +538,9 @@ static int adpcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
ADPCMChannelStatus *status = &c->status[ch];
const int16_t *smp = &samples_p[ch][1 + i * 8];
for (j = 0; j < 8; j += 2) {
- *dst++ = adpcm_ima_compress_sample(status, smp[j ]) |
- (adpcm_ima_compress_sample(status, smp[j + 1]) << 4);
+ uint8_t v = adpcm_ima_compress_sample(status, smp[j ]);
+ v |= (adpcm_ima_compress_sample(status, smp[j + 1]) << 4);
+ *dst++ = v;
}
}
}