[FFmpeg-cvslog] avfilter/silenceremove_template: improve ptp detector

Paul B Mahol git at videolan.org
Mon May 29 12:41:48 EEST 2023


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sun May 28 14:24:07 2023 +0200| [364c03d9fe1b7ca1b54644f5477eb75563e11bda] | committer: Paul B Mahol

avfilter/silenceremove_template: improve ptp detector

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

 libavfilter/silenceremove_template.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavfilter/silenceremove_template.c b/libavfilter/silenceremove_template.c
index c1335adb95..aaaba04f69 100644
--- a/libavfilter/silenceremove_template.c
+++ b/libavfilter/silenceremove_template.c
@@ -286,8 +286,8 @@ static ftype fn(compute_ptp)(ftype *peak, ftype sample, ftype wsample,
 
     peak[back] = sample;
     max = peak[front];
-    min = (back == front) ? -sample : sample;
-    r = FABS(max - min);
+    min = sample;
+    r = FABS(min) + FABS(max - min);
 
     *ffront = front;
     *bback = back;



More information about the ffmpeg-cvslog mailing list