diff mbox

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

Message ID 1506339079-14869-1-git-send-email-t.rapp@noa-archive.com
State New
Headers show

Commit Message

Tobias Rapp Sept. 25, 2017, 11:31 a.m. UTC
Align order of "start_time" option within filter documentation to actual
implementation 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@noa-archive.com>
---
 doc/filters.texi     | 22 +++++++++++-----------
 libavfilter/vf_fps.c | 12 ++++++------
 2 files changed, 17 insertions(+), 17 deletions(-)

Comments

Michael Niedermayer Oct. 4, 2017, 9:27 p.m. UTC | #1
On Mon, Sep 25, 2017 at 01:31:18PM +0200, Tobias Rapp wrote:
> Align order of "start_time" option within filter documentation to actual
> implementation 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.

This sounds a bit like it could be split into multiple commits

but the content all LGTM

thx


[...]
Tobias Rapp Oct. 5, 2017, 8:37 a.m. UTC | #2
On 04.10.2017 23:27, Michael Niedermayer wrote:
> On Mon, Sep 25, 2017 at 01:31:18PM +0200, Tobias Rapp wrote:
>> Align order of "start_time" option within filter documentation to actual
>> implementation 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.
> 
> This sounds a bit like it could be split into multiple commits
> 
> but the content all LGTM

Patch split and applied, thanks for review.

Regards,
Tobias
diff mbox

Patch

diff --git a/doc/filters.texi b/doc/filters.texi
index b09c3a0..a46865f 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -8669,13 +8669,21 @@  It accepts the following parameters:
 @item fps
 The desired output frame rate. The default is @code{25}.
 
+@item start_time
+Assume the first PTS should be the given value, in seconds. This allows for
+padding/trimming at the start of stream. By default, no assumption is made
+about the first frame's expected PTS, so no padding or trimming is done.
+For example, this could be set to 0 to pad the beginning with duplicates of
+the first frame if a video stream starts after the audio stream or to trim any
+frames with a negative PTS.
+
 @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
@@ -8687,18 +8695,10 @@  round to nearest
 @end table
 The default is @code{near}.
 
-@item start_time
-Assume the first PTS should be the given value, in seconds. This allows for
-padding/trimming at the start of stream. By default, no assumption is made
-about the first frame's expected PTS, so no padding or trimming is done.
-For example, this could be set to 0 to pad the beginning with duplicates of
-the first frame if a video stream starts after the audio stream or to trim any
-frames with a negative PTS.
-
 @end table
 
 Alternatively, the options can be specified as a flat string:
-@var{fps}[:@var{round}].
+@var{fps}[:@var{start_time}[:@var{round}]].
 
 See also the @ref{setpts} filter.
 
diff --git a/libavfilter/vf_fps.c b/libavfilter/vf_fps.c
index 1e5d07e..a5e51c3 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 },
+    { "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 },
     { "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" },
     { NULL }
 };