[FFmpeg-cvslog] avfilter/silenceremove_template: skip silence start detection after start-only trimming is over

Paul B Mahol git at videolan.org
Fri May 26 11:17:33 EEST 2023


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Fri May 26 09:24:22 2023 +0200| [f59d9514dae7cbdd465fbd22a64e05d679ba6ce3] | committer: Paul B Mahol

avfilter/silenceremove_template: skip silence start detection after start-only trimming is over

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

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

diff --git a/libavfilter/silenceremove_template.c b/libavfilter/silenceremove_template.c
index ef63ea1e7e..f5f0957240 100644
--- a/libavfilter/silenceremove_template.c
+++ b/libavfilter/silenceremove_template.c
@@ -197,6 +197,9 @@ static void fn(filter_start)(AVFilterContext *ctx,
                      start_nb_samples,
                      start_window_nb_samples);
 
+    if (s->start_found_periods < 0)
+        goto skip;
+
     if (s->detection != D_PEAK)
         window_size = s->start_window_size;
 
@@ -244,6 +247,7 @@ static void fn(filter_start)(AVFilterContext *ctx,
         s->start_sample_count = 0;
     }
 
+skip:
     if (s->start_found_periods < 0) {
         const int dst_pos = out_nb_samples * nb_channels;
         for (int ch = 0; ch < nb_channels; ch++)



More information about the ffmpeg-cvslog mailing list