[FFmpeg-cvslog] ffmpeg: use av_clip_int16 for audio clipping

Alex Converse git at videolan.org
Tue Aug 30 18:15:08 CEST 2011


ffmpeg | branch: master | Alex Converse <alex.converse at gmail.com> | Tue Aug 30 16:38:09 2011 +0200| [08fe874fa4999a9b2349b6cee2fca3761dd20e82] | committer: Michael Niedermayer

ffmpeg: use av_clip_int16 for audio clipping

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=08fe874fa4999a9b2349b6cee2fca3761dd20e82
---

 ffmpeg.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index 24cff11..56d7ee9 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1703,9 +1703,7 @@ static int output_packet(InputStream *ist, int ist_index,
                 volp = samples;
                 for(i=0;i<(decoded_data_size / sizeof(short));i++) {
                     int v = ((*volp) * audio_volume + 128) >> 8;
-                    if (v < -32768) v = -32768;
-                    if (v >  32767) v = 32767;
-                    *volp++ = v;
+                    *volp++ = av_clip_int16(v);
                 }
             }
         }



More information about the ffmpeg-cvslog mailing list