[FFmpeg-devel] [PATCH v6] avfilter/avf_aphasemeter: Add out-of-phase and mono detection
Moritz Barsnick
barsnick at gmx.net
Wed Aug 14 11:30:43 EEST 2019
On Tue, Aug 13, 2019 at 18:01:29 +0200, Romane Lafon wrote:
> + { "duration", "set minimum mono or out-of-phase duration in seconds", OFFSET(duration), AV_OPT_TYPE_DOUBLE, {.dbl=2.}, 0, 24*60*60, FLAGS },
ffmpeg also provides a AV_OPT_TYPE_DURATION. (This may have been
discussed before - sorry if so.)
> +static inline float get_index(AVFilterLink *inlink, AVFrame *in)
> +{
> + char *index_str = av_ts2timestr(in->pts, &inlink->time_base);
> + return atof(index_str);
> +}
Just wondering: Are you sure this works? The av_ts2timestr() macro is
specifically documented as such:
[...] the return value should be used only directly in
function arguments but never stand-alone
Likely because it defines a buffer locally which goes out of scope.
Cheers,
Moritz
More information about the ffmpeg-devel
mailing list