summaryrefslogtreecommitdiff
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorAlex Converse <alex.converse@gmail.com>2011-08-30 16:38:09 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-08-30 18:10:09 +0200
commit08fe874fa4999a9b2349b6cee2fca3761dd20e82 (patch)
tree1145e3428941d2ac6c3af23e7f372e24044de898 /ffmpeg.c
parentef24426599525e8165249785ae93df6dbe2e06d9 (diff)
ffmpeg: use av_clip_int16 for audio clipping
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index 24cff11ec0..56d7ee9bd0 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);
}
}
}