Showing the changes to libavfilter (1 of 1 file). Show all
Unified · Split
| @@ -120,7 +120,7 @@ static int config_input(AVFilterLink *inlink) · 119 unmodified lines | |||
| 120 | AVFilterContext *ctx = inlink->dst; | 120 | AVFilterContext *ctx = inlink->dst; |
| 121 | AudioHistogramContext *s = ctx->priv; | 121 | AudioHistogramContext *s = ctx->priv; |
| 122 | 122 | ||
| 123 | s->nb_samples = FFMAX(1, ((double)inlink->sample_rate / av_q2d(s->frame_rate)) + 0.5); | 123 | s->nb_samples = FFMAX(1, av_rescale(inlink->sample_rate, s->frame_rate.den, s->frame_rate.num)); |
| 124 | s->dchannels = s->dmode == SINGLE ? 1 : inlink->channels; | 124 | s->dchannels = s->dmode == SINGLE ? 1 : inlink->channels; |
| 125 | s->shistogram = av_calloc(s->w, s->dchannels * sizeof(*s->shistogram)); | 125 | s->shistogram = av_calloc(s->w, s->dchannels * sizeof(*s->shistogram)); |
| 126 | if (!s->shistogram) | 126 | if (!s->shistogram) |