History

avfilter/af_aiir: fix first delay value

Paul B Mahol committed 6 years ago

Commit 1fc5ddf1 parent 38490cb1 file · +2 −6Browse files

Unified · Split

libavfilter/af_aiir.c+2−6
@@ -823,7 +823,7 @@ static void draw_response(AVFilterContext *ctx, AVFrame *out, int sample_rate) · 822 unmodified lines
823{823{
824 AudioIIRContext *s = ctx->priv;824 AudioIIRContext *s = ctx->priv;
825 double *mag, *phase, *temp, *delay, min = DBL_MAX, max = -DBL_MAX;825 double *mag, *phase, *temp, *delay, min = DBL_MAX, max = -DBL_MAX;
826 double min_delay, max_delay, min_phase, max_phase;826 double min_delay = DBL_MAX, max_delay = -DBL_MAX, min_phase, max_phase;
827 int prev_ymag = -1, prev_yphase = -1, prev_ydelay = -1;827 int prev_ymag = -1, prev_yphase = -1, prev_ydelay = -1;
828 char text[32];828 char text[32];
829 int ch, i;829 int ch, i;
@@ -869,9 +869,6 @@ static void draw_response(AVFilterContext *ctx, AVFrame *out, int sample_rate) · 39 unmodified lines
869 max_phase = fmax(max_phase, phase[i]);869 max_phase = fmax(max_phase, phase[i]);
870 }870 }
871 871
872 delay[0] = 0.;
873 min_delay = 0.;
874 max_delay = 0.;
875 for (i = 0; i < s->w - 1; i++) {872 for (i = 0; i < s->w - 1; i++) {
876 double div = s->w / (double)sample_rate;873 double div = s->w / (double)sample_rate;
877 874
@@ -879,8 +876,7 @@ static void draw_response(AVFilterContext *ctx, AVFrame *out, int sample_rate) · 1 unmodified line
879 min_delay = fmin(min_delay, delay[i + 1]);876 min_delay = fmin(min_delay, delay[i + 1]);
880 max_delay = fmax(max_delay, delay[i + 1]);877 max_delay = fmax(max_delay, delay[i + 1]);
881 }878 }
882 879 delay[0] = delay[1];
883 delay[i] = delay[i - 1];
884 880
885 for (i = 0; i < s->w; i++) {881 for (i = 0; i < s->w; i++) {
886 int ymag = mag[i] / max * (s->h - 1);882 int ymag = mag[i] / max * (s->h - 1);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t