[FFmpeg-cvslog] avfilter/af_headphone: Remove pointless additions

Andreas Rheinhardt git at videolan.org
Wed Sep 9 16:00:25 EEST 2020


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at gmail.com> | Fri Aug 28 15:28:33 2020 +0200| [7b841cf6b706055164d5db3f2b901ed32e8092af] | committer: Andreas Rheinhardt

avfilter/af_headphone: Remove pointless additions

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 at gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>

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

 libavfilter/af_headphone.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavfilter/af_headphone.c b/libavfilter/af_headphone.c
index 8db546adbf..03ef88c4a4 100644
--- a/libavfilter/af_headphone.c
+++ b/libavfilter/af_headphone.c
@@ -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));



More information about the ffmpeg-cvslog mailing list