[email protected] (2018-10-03): > From: wang-bin <[email protected]> > > --- > libavfilter/af_atempo.c | 11 ++++++----- > 1 file changed, 6 insertions(+), 5 deletions(-) > > diff --git a/libavfilter/af_atempo.c b/libavfilter/af_atempo.c > index 52f15f2769..1a004212a7 100644 > --- a/libavfilter/af_atempo.c > +++ b/libavfilter/af_atempo.c > @@ -331,9 +331,10 @@ static int yae_set_tempo(AVFilterContext *ctx, const > char *arg_tempo) > return AVERROR(EINVAL); > } > > - if (tempo < 0.5 || tempo > 2.0) { > - av_log(ctx, AV_LOG_ERROR, "Tempo value %f exceeds [0.5, 2.0] > range\n", > - tempo);
> + const AVOption *o = av_opt_find(&atempo->class, "tempo", NULL, 0,
> AV_OPT_SEARCH_FAKE_OBJ);
> + if (tempo < o->min || tempo > o->max) {
The option is defined in the very same file and the min and max values
are hardcoded there. There is no need for a fragile lookup.
> + av_log(ctx, AV_LOG_ERROR, "Tempo value %f exceeds [%.1f, %.1f]
> range\n",
> + tempo, o->min, o->max);
> return AVERROR(EINVAL);
> }
>
> @@ -439,8 +440,8 @@ static int yae_load_data(ATempoContext *atempo,
> return 0;
> }
>
> - // samples are not expected to be skipped, unless tempo is greater than
> 2:
> - av_assert0(read_size <= atempo->ring || atempo->tempo > 2.0);
> + // samples are not expected to be skipped:
> + av_assert0(read_size <= atempo->ring);
Looks unrelated. Can you explain?
>
> while (atempo->position[0] < stop_here && src < src_end) {
> int src_samples = (src_end - src) / atempo->stride;
Regards,
--
Nicolas George
signature.asc
Description: Digital signature
_______________________________________________ ffmpeg-devel mailing list [email protected] http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
