Mercurial > libavcodec.hg
comparison wmadec.c @ 5523:c2ab2ac31edb libavcodec
use av_clip_int16() where it makes sense
author | aurel |
---|---|
date | Sat, 11 Aug 2007 22:48:55 +0000 |
parents | d2ef80f5fd7e |
children | bc4791868c52 |
comparison
equal
deleted
inserted
replaced
5522:acaaff7b6fb8 | 5523:c2ab2ac31edb |
---|---|
738 ptr = samples + ch; | 738 ptr = samples + ch; |
739 iptr = s->frame_out[ch]; | 739 iptr = s->frame_out[ch]; |
740 | 740 |
741 for(i=0;i<n;i++) { | 741 for(i=0;i<n;i++) { |
742 a = lrintf(*iptr++); | 742 a = lrintf(*iptr++); |
743 if (a > 32767) | 743 a = av_clip_int16(a); |
744 a = 32767; | |
745 else if (a < -32768) | |
746 a = -32768; | |
747 *ptr = a; | 744 *ptr = a; |
748 ptr += incr; | 745 ptr += incr; |
749 } | 746 } |
750 /* prepare for next block */ | 747 /* prepare for next block */ |
751 memmove(&s->frame_out[ch][0], &s->frame_out[ch][s->frame_len], | 748 memmove(&s->frame_out[ch][0], &s->frame_out[ch][s->frame_len], |