[FFmpeg-cvslog] avconv: Reformat s16 volume adjustment.

Alex Converse git at videolan.org
Thu Sep 29 01:19:13 CEST 2011


ffmpeg | branch: master | Alex Converse <alex.converse at gmail.com> | Tue Sep 27 10:24:28 2011 -0700| [daf98908118074e96199ca7195663af4543d3808] | committer: Alex Converse

avconv: Reformat s16 volume adjustment.

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

 avconv.c |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/avconv.c b/avconv.c
index d6003dd..c418b7c 100644
--- a/avconv.c
+++ b/avconv.c
@@ -1676,13 +1676,12 @@ static int output_packet(InputStream *ist, int ist_index,
                 }
                 case AV_SAMPLE_FMT_S16:
                 {
-                short *volp;
-                volp = samples;
-                for(i=0;i<(decoded_data_size / sizeof(short));i++) {
-                    int v = ((*volp) * audio_volume + 128) >> 8;
-                    *volp++ = av_clip_int16(v);
-                }
-                break;
+                    int16_t *volp = samples;
+                    for (i = 0; i < (decoded_data_size / sizeof(*volp)); i++) {
+                        int v = ((*volp) * audio_volume + 128) >> 8;
+                        *volp++ = av_clip_int16(v);
+                    }
+                    break;
                 }
                 case AV_SAMPLE_FMT_S32:
                 {



More information about the ffmpeg-cvslog mailing list