use av_clip_int16() where it makes sense

Originally committed as revision 10078 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Aurelien Jacobs
2007-08-11 22:48:55 +00:00
parent 160ab30fcc
commit aee481cebe
14 changed files with 34 additions and 64 deletions

View File

@@ -895,13 +895,13 @@ static int atrac3_decode_frame(AVCodecContext *avctx,
if (q->channels == 1) {
/* mono */
for (i = 0; i<1024; i++)
samples[i] = av_clip(round(q->outSamples[i]), -32768, 32767);
samples[i] = av_clip_int16(round(q->outSamples[i]));
*data_size = 1024 * sizeof(int16_t);
} else {
/* stereo */
for (i = 0; i < 1024; i++) {
samples[i*2] = av_clip(round(q->outSamples[i]), -32768, 32767);
samples[i*2+1] = av_clip(round(q->outSamples[1024+i]), -32768, 32767);
samples[i*2] = av_clip_int16(round(q->outSamples[i]));
samples[i*2+1] = av_clip_int16(round(q->outSamples[1024+i]));
}
*data_size = 2048 * sizeof(int16_t);
}