[FFmpeg-cvslog] avfilter/af_silenceremove: speed-up start-only trimming once trim is over

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


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Fri May 26 09:54:40 2023 +0200| [29710dd7f2d771ca83ae3b7701b4354b5233e4f3] | committer: Paul B Mahol

avfilter/af_silenceremove: speed-up start-only trimming once trim is over

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

 libavfilter/af_silenceremove.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libavfilter/af_silenceremove.c b/libavfilter/af_silenceremove.c
index 28c972f86f..a3ad0eea13 100644
--- a/libavfilter/af_silenceremove.c
+++ b/libavfilter/af_silenceremove.c
@@ -372,6 +372,12 @@ static int activate(AVFilterContext *ctx)
     if (ret < 0)
         return ret;
     if (ret > 0) {
+        if (s->start_periods == 1 && s->stop_periods == 0 &&
+            s->start_found_periods < 0) {
+            in->pts = s->next_pts;
+            s->next_pts += in->nb_samples;
+            return ff_filter_frame(outlink, in);
+        }
         if (s->start_periods == 0 && s->stop_periods == 0)
             return ff_filter_frame(outlink, in);
         return filter_frame(outlink, in);



More information about the ffmpeg-cvslog mailing list