avconv: Reformat s16 volume adjustment.
authorAlex Converse <alex.converse@gmail.com>
Tue, 27 Sep 2011 17:24:28 +0000 (10:24 -0700)
committerAlex Converse <alex.converse@gmail.com>
Wed, 28 Sep 2011 19:33:51 +0000 (12:33 -0700)
avconv.c

index d6003dd..c418b7c 100644 (file)
--- 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:
                 {