[FFmpeg-devel] [PATCH 1/2] avfilter/vf_fps: clean-up filter options

Michael Niedermayer michael at niedermayer.cc
Fri Sep 22 02:58:00 EEST 2017


On Thu, Sep 21, 2017 at 04:55:51PM +0200, Tobias Rapp wrote:
> Align order of "start_time" option to documentation and add missing
> AV_OPT_FLAG_FILTERING_PARAM flag. Fix indent of "round" named constants
> and clear unused field values.
> 
> Also fix some documentation cosmetics.
> 
> Signed-off-by: Tobias Rapp <t.rapp at noa-archive.com>
> ---
>  doc/filters.texi     |  4 ++--
>  libavfilter/vf_fps.c | 12 ++++++------
>  2 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/doc/filters.texi b/doc/filters.texi
> index 830de54..96b3dfd 100644
> --- a/doc/filters.texi
> +++ b/doc/filters.texi
> @@ -8670,12 +8670,12 @@ It accepts the following parameters:
>  The desired output frame rate. The default is @code{25}.
>  
>  @item round
> -Rounding method.
> +Timestamp (PTS) rounding method.
>  
>  Possible values are:
>  @table @option
>  @item zero
> -zero round towards 0
> +round towards 0
>  @item inf
>  round away from 0
>  @item down
> diff --git a/libavfilter/vf_fps.c b/libavfilter/vf_fps.c
> index 1e5d07e..0db2b48 100644
> --- a/libavfilter/vf_fps.c
> +++ b/libavfilter/vf_fps.c
> @@ -65,13 +65,13 @@ typedef struct FPSContext {
>  #define F AV_OPT_FLAG_FILTERING_PARAM
>  static const AVOption fps_options[] = {
>      { "fps", "A string describing desired output framerate", OFFSET(framerate), AV_OPT_TYPE_VIDEO_RATE, { .str = "25" }, 0, INT_MAX, V|F },
> -    { "start_time", "Assume the first PTS should be this value.", OFFSET(start_time), AV_OPT_TYPE_DOUBLE, { .dbl = DBL_MAX}, -DBL_MAX, DBL_MAX, V },
>      { "round", "set rounding method for timestamps", OFFSET(rounding), AV_OPT_TYPE_INT, { .i64 = AV_ROUND_NEAR_INF }, 0, 5, V|F, "round" },
> -    { "zero", "round towards 0",      OFFSET(rounding), AV_OPT_TYPE_CONST, { .i64 = AV_ROUND_ZERO     }, 0, 5, V|F, "round" },
> -    { "inf",  "round away from 0",    OFFSET(rounding), AV_OPT_TYPE_CONST, { .i64 = AV_ROUND_INF      }, 0, 5, V|F, "round" },
> -    { "down", "round towards -infty", OFFSET(rounding), AV_OPT_TYPE_CONST, { .i64 = AV_ROUND_DOWN     }, 0, 5, V|F, "round" },
> -    { "up",   "round towards +infty", OFFSET(rounding), AV_OPT_TYPE_CONST, { .i64 = AV_ROUND_UP       }, 0, 5, V|F, "round" },
> -    { "near", "round to nearest",     OFFSET(rounding), AV_OPT_TYPE_CONST, { .i64 = AV_ROUND_NEAR_INF }, 0, 5, V|F, "round" },
> +        { "zero", "round towards 0",                 0, AV_OPT_TYPE_CONST, { .i64 = AV_ROUND_ZERO     }, 0, 0, V|F, "round" },
> +        { "inf",  "round away from 0",               0, AV_OPT_TYPE_CONST, { .i64 = AV_ROUND_INF      }, 0, 0, V|F, "round" },
> +        { "down", "round towards -infty",            0, AV_OPT_TYPE_CONST, { .i64 = AV_ROUND_DOWN     }, 0, 0, V|F, "round" },
> +        { "up",   "round towards +infty",            0, AV_OPT_TYPE_CONST, { .i64 = AV_ROUND_UP       }, 0, 0, V|F, "round" },
> +        { "near", "round to nearest",                0, AV_OPT_TYPE_CONST, { .i64 = AV_ROUND_NEAR_INF }, 0, 0, V|F, "round" },
> +    { "start_time", "Assume the first PTS should be this value.", OFFSET(start_time), AV_OPT_TYPE_DOUBLE, { .dbl = DBL_MAX}, -DBL_MAX, DBL_MAX, V|F },
>      { NULL }

This breaks shorthand notation like fps=30:-0.01

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

No human being will ever know the Truth, for even if they happen to say it
by chance, they would not even known they had done so. -- Xenophanes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20170922/5e098d21/attachment.sig>


More information about the ffmpeg-devel mailing list