[FFmpeg-cvslog] avfilter/avf_showfreqs/showspectrum: rename skip_samples to hop_size

Paul B Mahol git at videolan.org
Mon Jan 18 19:40:55 CET 2016


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Mon Jan 18 19:38:14 2016 +0100| [4e17efd852bd3d83d1b6465614fc2d44be8e3e3d] | committer: Paul B Mahol

avfilter/avf_showfreqs/showspectrum: rename skip_samples to hop_size

Signed-off-by: Paul B Mahol <onemda at gmail.com>

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

 libavfilter/avf_showfreqs.c    |   10 +++++-----
 libavfilter/avf_showspectrum.c |   10 +++++-----
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/libavfilter/avf_showfreqs.c b/libavfilter/avf_showfreqs.c
index 311dd47..6323887 100644
--- a/libavfilter/avf_showfreqs.c
+++ b/libavfilter/avf_showfreqs.c
@@ -53,7 +53,7 @@ typedef struct ShowFreqsContext {
     float **avg_data;
     float *window_func_lut;
     float overlap;
-    int skip_samples;
+    int hop_size;
     int nb_channels;
     int nb_freq;
     int win_size;
@@ -205,8 +205,8 @@ static int config_output(AVFilterLink *outlink)
     ff_generate_window_func(s->window_func_lut, s->win_size, s->win_func, &overlap);
     if (s->overlap == 1.)
         s->overlap = overlap;
-    s->skip_samples = (1. - s->overlap) * s->win_size;
-    if (s->skip_samples < 1) {
+    s->hop_size = (1. - s->overlap) * s->win_size;
+    if (s->hop_size < 1) {
         av_log(ctx, AV_LOG_ERROR, "overlap %f too big\n", s->overlap);
         return AVERROR(EINVAL);
     }
@@ -434,14 +434,14 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
         }
 
         fin->pts = s->pts;
-        s->pts += s->skip_samples;
+        s->pts += s->hop_size;
         ret = av_audio_fifo_peek(s->fifo, (void **)fin->extended_data, s->win_size);
         if (ret < 0)
             goto fail;
 
         ret = plot_freqs(inlink, fin);
         av_frame_free(&fin);
-        av_audio_fifo_drain(s->fifo, s->skip_samples);
+        av_audio_fifo_drain(s->fifo, s->hop_size);
         if (ret < 0)
             goto fail;
     }
diff --git a/libavfilter/avf_showspectrum.c b/libavfilter/avf_showspectrum.c
index 424d1f2..3efd000 100644
--- a/libavfilter/avf_showspectrum.c
+++ b/libavfilter/avf_showspectrum.c
@@ -74,7 +74,7 @@ typedef struct {
     double win_scale;
     float overlap;
     float gain;
-    int skip_samples;
+    int hop_size;
     float *combine_buffer;      ///< color combining buffer (3 * h items)
     AVAudioFifo *fifo;
     int64_t pts;
@@ -367,8 +367,8 @@ static int config_output(AVFilterLink *outlink)
         ff_generate_window_func(s->window_func_lut, s->win_size, s->win_func, &overlap);
         if (s->overlap == 1)
             s->overlap = overlap;
-        s->skip_samples = (1. - s->overlap) * s->win_size;
-        if (s->skip_samples < 1) {
+        s->hop_size = (1. - s->overlap) * s->win_size;
+        if (s->hop_size < 1) {
             av_log(ctx, AV_LOG_ERROR, "overlap %f too big\n", s->overlap);
             return AVERROR(EINVAL);
         }
@@ -805,7 +805,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
         }
 
         fin->pts = s->pts;
-        s->pts += s->skip_samples;
+        s->pts += s->hop_size;
         ret = av_audio_fifo_peek(s->fifo, (void **)fin->extended_data, s->win_size);
         if (ret < 0)
             goto fail;
@@ -820,7 +820,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
 
         ret = plot_spectrum_column(inlink, fin);
         av_frame_free(&fin);
-        av_audio_fifo_drain(s->fifo, s->skip_samples);
+        av_audio_fifo_drain(s->fifo, s->hop_size);
         if (ret < 0)
             goto fail;
     }



More information about the ffmpeg-cvslog mailing list