mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 14:26:43 +00:00
audioamplify: Fix off-by-one in wrap-positive mode
This commit is contained in:
parent
afccf53ace
commit
ffe64fb934
1 changed files with 2 additions and 2 deletions
|
@ -176,10 +176,10 @@ gst_audio_amplify_transform_##type##_wrap_negative (GstAudioAmplify * filter, \
|
|||
while (num_samples--) { \
|
||||
glong val = *d * filter->amplification; \
|
||||
if (val > MAX_##type) \
|
||||
val = MIN_##type + (val - MIN_##type) % ((glong) MAX_##type - \
|
||||
val = MIN_##type + (val - MIN_##type) % ((glong) MAX_##type + 1 - \
|
||||
MIN_##type); \
|
||||
else if (val < MIN_##type) \
|
||||
val = MAX_##type - (MAX_##type - val) % ((glong) MAX_##type - \
|
||||
val = MAX_##type - (MAX_##type - val) % ((glong) MAX_##type + 1 - \
|
||||
MIN_##type); \
|
||||
*d++ = val; \
|
||||
} \
|
||||
|
|
Loading…
Reference in a new issue