libavfilter/ebur128: add target value to statistics line
[ffmpeg.git] / libavfilter / vaf_spectrumsynth.c
index ab9a69b..fed2cbb 100644 (file)
@@ -27,6 +27,7 @@
 #include "libavcodec/avfft.h"
 #include "libavutil/avassert.h"
 #include "libavutil/channel_layout.h"
+#include "libavutil/ffmath.h"
 #include "libavutil/opt.h"
 #include "libavutil/parseutils.h"
 #include "avfilter.h"
@@ -209,7 +210,7 @@ static int config_output(AVFilterLink *outlink)
                                       sizeof(*s->window_func_lut));
     if (!s->window_func_lut)
         return AVERROR(ENOMEM);
-    ff_generate_window_func(s->window_func_lut, s->win_size, s->win_func, &overlap);
+    generate_window_func(s->window_func_lut, s->win_size, s->win_func, &overlap);
     if (s->overlap == 1)
         s->overlap = overlap;
     s->hop_size = (1 - s->overlap) * s->win_size;
@@ -256,6 +257,8 @@ static void read16_fft_bin(SpectrumSynthContext *s,
     case LOG:
         magnitude = ff_exp10(((m[x] / (double)UINT16_MAX) - 1.) * 6.);
         break;
+    default:
+        av_assert0(0);
     }
     phase = ((p[x] / (double)UINT16_MAX) * 2. - 1.) * M_PI;
 
@@ -279,6 +282,8 @@ static void read8_fft_bin(SpectrumSynthContext *s,
     case LOG:
         magnitude = ff_exp10(((m[x] / (double)UINT8_MAX) - 1.) * 6.);
         break;
+    default:
+        av_assert0(0);
     }
     phase = ((p[x] / (double)UINT8_MAX) * 2. - 1.) * M_PI;
 
@@ -414,6 +419,8 @@ static int try_push_frame(AVFilterContext *ctx, int x)
                 }
 
                 ret = ff_filter_frame(outlink, out);
+                if (ret < 0)
+                    return ret;
             }
         }
     }
@@ -442,11 +449,11 @@ static int try_push_frames(AVFilterContext *ctx)
     case SCROLL:
         s->xpos = s->xend - 1;
         ret = try_push_frame(ctx, s->xpos);
+        break;
     case RSCROLL:
         s->xpos = 0;
         ret = try_push_frame(ctx, s->xpos);
         break;
-        break;
     case FULLFRAME:
         for (x = 0; x < s->xend; x++) {
             ret = try_push_frame(ctx, x);
@@ -454,6 +461,8 @@ static int try_push_frames(AVFilterContext *ctx)
                 break;
         }
         break;
+    default:
+        av_assert0(0);
     }
 
     av_frame_free(&s->magnitude);