Commit 1fc5ddf7 authored by Paul B Mahol's avatar Paul B Mahol

avfilter/af_aiir: fix first delay value

parent 38490cbe
...@@ -823,7 +823,7 @@ static void draw_response(AVFilterContext *ctx, AVFrame *out, int sample_rate) ...@@ -823,7 +823,7 @@ static void draw_response(AVFilterContext *ctx, AVFrame *out, int sample_rate)
{ {
AudioIIRContext *s = ctx->priv; AudioIIRContext *s = ctx->priv;
double *mag, *phase, *temp, *delay, min = DBL_MAX, max = -DBL_MAX; double *mag, *phase, *temp, *delay, min = DBL_MAX, max = -DBL_MAX;
double min_delay, max_delay, min_phase, max_phase; double min_delay = DBL_MAX, max_delay = -DBL_MAX, min_phase, max_phase;
int prev_ymag = -1, prev_yphase = -1, prev_ydelay = -1; int prev_ymag = -1, prev_yphase = -1, prev_ydelay = -1;
char text[32]; char text[32];
int ch, i; int ch, i;
...@@ -869,9 +869,6 @@ static void draw_response(AVFilterContext *ctx, AVFrame *out, int sample_rate) ...@@ -869,9 +869,6 @@ static void draw_response(AVFilterContext *ctx, AVFrame *out, int sample_rate)
max_phase = fmax(max_phase, phase[i]); max_phase = fmax(max_phase, phase[i]);
} }
delay[0] = 0.;
min_delay = 0.;
max_delay = 0.;
for (i = 0; i < s->w - 1; i++) { for (i = 0; i < s->w - 1; i++) {
double div = s->w / (double)sample_rate; double div = s->w / (double)sample_rate;
...@@ -879,8 +876,7 @@ static void draw_response(AVFilterContext *ctx, AVFrame *out, int sample_rate) ...@@ -879,8 +876,7 @@ static void draw_response(AVFilterContext *ctx, AVFrame *out, int sample_rate)
min_delay = fmin(min_delay, delay[i + 1]); min_delay = fmin(min_delay, delay[i + 1]);
max_delay = fmax(max_delay, delay[i + 1]); max_delay = fmax(max_delay, delay[i + 1]);
} }
delay[0] = delay[1];
delay[i] = delay[i - 1];
for (i = 0; i < s->w; i++) { for (i = 0; i < s->w; i++) {
int ymag = mag[i] / max * (s->h - 1); int ymag = mag[i] / max * (s->h - 1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment