History

avfilter/avf_showvolume: make use of av_rescale

Paul B Mahol committed 7 years ago

Commit d2e76a11 parent 618f8bb1 file · +1 −1Browse files

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

Unified · Split

libavfilter/avf_showvolume.c+1−1
@@ -165,7 +165,7 @@ static int config_input(AVFilterLink *inlink) · 164 unmodified lines
165165 AVFilterContext *ctx = inlink->dst;
166166 ShowVolumeContext *s = ctx->priv;
167167
168− s->nb_samples = FFMAX(1024, ((double)inlink->sample_rate / av_q2d(s->frame_rate)) + 0.5);
168+ s->nb_samples = FFMAX(1, av_rescale(inlink->sample_rate, s->frame_rate.den, s->frame_rate.num));
169169 s->values = av_calloc(inlink->channels * VAR_VARS_NB, sizeof(double));
170170 if (!s->values)
171171 return AVERROR(ENOMEM);

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