diff mbox series

[FFmpeg-devel,9/9] avfilter/avfilter: Remove unused partial_buf

Message ID AM7PR03MB6660ABFF78ECAC244C52B04D8FF29@AM7PR03MB6660.eurprd03.prod.outlook.com
State Accepted
Commit 304cb08693220b1e8a09273f28688537fd9ff39e
Headers show
Series [FFmpeg-devel,1/9] avformat/aviobuf: Avoid calling function twice due to FFMAX() | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Andreas Rheinhardt Aug. 5, 2021, 5:42 a.m. UTC
It is unused since 02aa0701ae0dc2def8db640c9e3c06dc1b5de70c.
The corresponding size field is write-only since then.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
I was quite surprised to find this.

 libavfilter/af_firequalizer.c |  2 +-
 libavfilter/af_loudnorm.c     |  6 ++----
 libavfilter/af_lv2.c          |  2 +-
 libavfilter/af_replaygain.c   |  1 -
 libavfilter/avf_aphasemeter.c |  1 -
 libavfilter/avfilter.c        |  1 -
 libavfilter/avfilter.h        | 13 +------------
 libavfilter/buffersink.c      |  3 +--
 libavfilter/f_ebur128.c       |  3 +--
 9 files changed, 7 insertions(+), 25 deletions(-)

Comments

Nicolas George Aug. 5, 2021, 7:59 a.m. UTC | #1
Andreas Rheinhardt (12021-08-05):
> It is unused since 02aa0701ae0dc2def8db640c9e3c06dc1b5de70c.
> The corresponding size field is write-only since then.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
> I was quite surprised to find this.

LGTM, good catch.

Regards,
diff mbox series

Patch

diff --git a/libavfilter/af_firequalizer.c b/libavfilter/af_firequalizer.c
index a4de76ee0f..77de69e3ef 100644
--- a/libavfilter/af_firequalizer.c
+++ b/libavfilter/af_firequalizer.c
@@ -837,7 +837,7 @@  static int config_input(AVFilterLink *inlink)
            inlink->sample_rate, inlink->channels, s->analysis_rdft_len, s->rdft_len, s->fir_len, s->nsamples_max);
 
     if (s->fixed)
-        inlink->min_samples = inlink->max_samples = inlink->partial_buf_size = s->nsamples_max;
+        inlink->min_samples = inlink->max_samples = s->nsamples_max;
 
     return generate_kernel(ctx, SELECT_GAIN(s), SELECT_GAIN_ENTRY(s));
 }
diff --git a/libavfilter/af_loudnorm.c b/libavfilter/af_loudnorm.c
index 5a3e762b27..a07e8a3c93 100644
--- a/libavfilter/af_loudnorm.c
+++ b/libavfilter/af_loudnorm.c
@@ -504,8 +504,7 @@  static int filter_frame(AVFilterLink *inlink, AVFrame *in)
         s->pts +=
         out->nb_samples =
         inlink->min_samples =
-        inlink->max_samples =
-        inlink->partial_buf_size = subframe_length;
+        inlink->max_samples = subframe_length;
 
         s->frame_type = INNER_FRAME;
         break;
@@ -761,8 +760,7 @@  static int config_input(AVFilterLink *inlink)
 
     if (s->frame_type != LINEAR_MODE) {
         inlink->min_samples =
-        inlink->max_samples =
-        inlink->partial_buf_size = frame_size(inlink->sample_rate, 3000);
+        inlink->max_samples = frame_size(inlink->sample_rate, 3000);
     }
 
     s->pts = AV_NOPTS_VALUE;
diff --git a/libavfilter/af_lv2.c b/libavfilter/af_lv2.c
index cc5d702e27..28b729691d 100644
--- a/libavfilter/af_lv2.c
+++ b/libavfilter/af_lv2.c
@@ -380,7 +380,7 @@  static int config_output(AVFilterLink *outlink)
          lilv_plugin_has_feature(s->plugin, s->boundedBlockLength))) {
         AVFilterLink *inlink = ctx->inputs[0];
 
-        inlink->partial_buf_size = inlink->min_samples = inlink->max_samples = 4096;
+        inlink->min_samples = inlink->max_samples = 4096;
     }
 
     return 0;
diff --git a/libavfilter/af_replaygain.c b/libavfilter/af_replaygain.c
index a5f5959eb3..fd642297f8 100644
--- a/libavfilter/af_replaygain.c
+++ b/libavfilter/af_replaygain.c
@@ -359,7 +359,6 @@  static int config_input(AVFilterLink *inlink)
 
     s->yule_hist_i   = 20;
     s->butter_hist_i = 4;
-    inlink->partial_buf_size =
     inlink->min_samples =
     inlink->max_samples = inlink->sample_rate / 20;
 
diff --git a/libavfilter/avf_aphasemeter.c b/libavfilter/avf_aphasemeter.c
index ef7e50e657..a31805f204 100644
--- a/libavfilter/avf_aphasemeter.c
+++ b/libavfilter/avf_aphasemeter.c
@@ -131,7 +131,6 @@  static int config_input(AVFilterLink *inlink)
 
     if (s->do_video) {
         nb_samples = FFMAX(1, av_rescale(inlink->sample_rate, s->frame_rate.den, s->frame_rate.num));
-        inlink->partial_buf_size =
         inlink->min_samples =
         inlink->max_samples = nb_samples;
     }
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index 24de8ebee3..1655a21f46 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -177,7 +177,6 @@  void avfilter_link_free(AVFilterLink **link)
     if (!*link)
         return;
 
-    av_frame_free(&(*link)->partial_buf);
     ff_framequeue_free(&(*link)->fifo);
     ff_frame_pool_uninit((FFFramePool**)&(*link)->frame_pool);
 
diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h
index b82f72d040..e0914a151e 100644
--- a/libavfilter/avfilter.h
+++ b/libavfilter/avfilter.h
@@ -548,20 +548,9 @@  struct AVFilterLink {
      */
     AVRational frame_rate;
 
-    /**
-     * Buffer partially filled with samples to achieve a fixed/minimum size.
-     */
-    AVFrame *partial_buf;
-
-    /**
-     * Size of the partial buffer to allocate.
-     * Must be between min_samples and max_samples.
-     */
-    int partial_buf_size;
-
     /**
      * Minimum number of samples to filter at once. If filter_frame() is
-     * called with fewer samples, it will accumulate them in partial_buf.
+     * called with fewer samples, it will accumulate them in fifo.
      * This field and the related ones must not be changed after filtering
      * has started.
      * If 0, all related fields are ignored.
diff --git a/libavfilter/buffersink.c b/libavfilter/buffersink.c
index c4147bf732..07c4812f29 100644
--- a/libavfilter/buffersink.c
+++ b/libavfilter/buffersink.c
@@ -199,8 +199,7 @@  void av_buffersink_set_frame_size(AVFilterContext *ctx, unsigned frame_size)
 {
     AVFilterLink *inlink = ctx->inputs[0];
 
-    inlink->min_samples = inlink->max_samples =
-    inlink->partial_buf_size = frame_size;
+    inlink->min_samples = inlink->max_samples = frame_size;
 }
 
 #define MAKE_AVFILTERLINK_ACCESSOR(type, field) \
diff --git a/libavfilter/f_ebur128.c b/libavfilter/f_ebur128.c
index bf7bb3af68..47ea9b59d7 100644
--- a/libavfilter/f_ebur128.c
+++ b/libavfilter/f_ebur128.c
@@ -413,8 +413,7 @@  static int config_audio_input(AVFilterLink *inlink)
      * filter_frame()). */
     if (ebur128->metadata || (ebur128->peak_mode & PEAK_MODE_TRUE_PEAKS))
         inlink->min_samples =
-        inlink->max_samples =
-        inlink->partial_buf_size = inlink->sample_rate / 10;
+        inlink->max_samples = inlink->sample_rate / 10;
     return 0;
 }