]> git.sesse.net Git - ffmpeg/commitdiff
avfilter/af_headphone: Remove pointless additions
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Fri, 28 Aug 2020 13:28:33 +0000 (15:28 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Wed, 9 Sep 2020 11:48:18 +0000 (13:48 +0200)
buffer_length is a power-of-two and modulo is buffer_length - 1, so that
buffer_length & modulo is zero.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavfilter/af_headphone.c

index 8db546adbfc8273ed289f3c2b25c0d4ed9b2d0e6..03ef88c4a426fa4904f5b1ba7f26f5fd00e68145 100644 (file)
@@ -178,7 +178,7 @@ static int headphone_convolute(AVFilterContext *ctx, void *arg, int jobnr, int n
                 continue;
             }
 
-            read = (wr - (ir_len - 1) + buffer_length) & modulo;
+            read = (wr - (ir_len - 1)) & modulo;
 
             if (read + ir_len < buffer_length) {
                 memcpy(temp_src, bptr + read, ir_len * sizeof(*temp_src));