diff options
author | Paul B Mahol <onemda@gmail.com> | 2013-07-10 19:08:16 +0000 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2013-07-10 19:13:28 +0000 |
commit | 1e89f74902c60db08828dab980e408a4b65811c8 (patch) | |
tree | 19c83518018936b47112ccc707c72ccf01f2d0e3 /libavfilter/af_afade.c | |
parent | 2ea60971dca9904f056020a54a8476e49f904f3f (diff) | |
download | ffmpeg-1e89f74902c60db08828dab980e408a4b65811c8.tar.gz |
lavfi/afade: use av_rescale()
Should not make a difference, but its good idea.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavfilter/af_afade.c')
-rw-r--r-- | libavfilter/af_afade.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/libavfilter/af_afade.c b/libavfilter/af_afade.c index baced60a32..92e41cc733 100644 --- a/libavfilter/af_afade.c +++ b/libavfilter/af_afade.c @@ -200,11 +200,10 @@ FADE(flt, float) FADE(s16, int16_t) FADE(s32, int32_t) -static int config_output(AVFilterLink *outlink) +static int config_input(AVFilterLink *inlink) { - AVFilterContext *ctx = outlink->src; + AVFilterContext *ctx = inlink->dst; AudioFadeContext *afade = ctx->priv; - AVFilterLink *inlink = ctx->inputs[0]; switch (inlink->format) { case AV_SAMPLE_FMT_DBL: afade->fade_samples = fade_samples_dbl; break; @@ -218,9 +217,9 @@ static int config_output(AVFilterLink *outlink) } if (afade->duration) - afade->nb_samples = afade->duration * inlink->sample_rate / AV_TIME_BASE; + afade->nb_samples = av_rescale(afade->duration, inlink->sample_rate, AV_TIME_BASE); if (afade->start_time) - afade->start_sample = afade->start_time * inlink->sample_rate / AV_TIME_BASE; + afade->start_sample = av_rescale(afade->start_time, inlink->sample_rate, AV_TIME_BASE); return 0; } @@ -275,6 +274,7 @@ static const AVFilterPad avfilter_af_afade_inputs[] = { .name = "default", .type = AVMEDIA_TYPE_AUDIO, .filter_frame = filter_frame, + .config_props = config_input, }, { NULL } }; @@ -283,7 +283,6 @@ static const AVFilterPad avfilter_af_afade_outputs[] = { { .name = "default", .type = AVMEDIA_TYPE_AUDIO, - .config_props = config_output, }, { NULL } }; |