[FFmpeg-cvslog] avfilter/af_speechnorm: add timeline support

Paul B Mahol git at videolan.org
Wed Sep 8 23:13:52 EEST 2021


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Wed Sep  8 22:11:06 2021 +0200| [3df55c7bd6c4a101b3baa7933415db016be63f45] | committer: Paul B Mahol

avfilter/af_speechnorm: add timeline support

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

 libavfilter/af_speechnorm.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavfilter/af_speechnorm.c b/libavfilter/af_speechnorm.c
index fa56276e1d..35f8fe81a1 100644
--- a/libavfilter/af_speechnorm.c
+++ b/libavfilter/af_speechnorm.c
@@ -315,7 +315,7 @@ static void filter_channels_## name (AVFilterContext *ctx,
             av_assert0(size > 0);                                               \
             gain = cc->gain_state;                                              \
             consume_pi(cc, size);                                               \
-            for (int i = n; i < n + size; i++)                                  \
+            for (int i = n; !ctx->is_disabled && i < n + size; i++)             \
                 dst[i] *= gain;                                                 \
             n += size;                                                          \
         }                                                                       \
@@ -375,7 +375,7 @@ static void filter_link_channels_## name (AVFilterContext *ctx,
             if (cc->bypass)                                                     \
                 continue;                                                       \
                                                                                 \
-            for (int i = n; i < n + min_size; i++) {                            \
+            for (int i = n; !ctx->is_disabled && i < n + min_size; i++) {       \
                 ptype g = tlerp(s->prev_gain, gain, (i - n) / (ptype)min_size); \
                 dst[i] *= g;                                                    \
             }                                                                   \
@@ -568,5 +568,6 @@ const AVFilter ff_af_speechnorm = {
     .uninit          = uninit,
     FILTER_INPUTS(inputs),
     FILTER_OUTPUTS(outputs),
+    .flags           = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL,
     .process_command = process_command,
 };



More information about the ffmpeg-cvslog mailing list