History

avfilter/avf_ahistogram: make use of av_rescale

Paul B Mahol committed 7 years ago

Commit cd753961 parent d2e76a11 file · +1 −1Browse files

Showing the changes to libavfilter (1 of 1 file). Show all

Unified · Split

libavfilter/avf_ahistogram.c+1−1
@@ -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)

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