[FFmpeg-cvslog] lavfi/afade: use av_rescale()
Paul B Mahol
git at videolan.org
Wed Jul 10 21:13:59 CEST 2013
ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Wed Jul 10 19:08:16 2013 +0000| [1e89f74902c60db08828dab980e408a4b65811c8] | committer: Paul B Mahol
lavfi/afade: use av_rescale()
Should not make a difference, but its good idea.
Signed-off-by: Paul B Mahol <onemda at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1e89f74902c60db08828dab980e408a4b65811c8
---
libavfilter/af_afade.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/libavfilter/af_afade.c b/libavfilter/af_afade.c
index baced60..92e41cc 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 }
};
More information about the ffmpeg-cvslog
mailing list