---
libavfilter/vf_tpad.c | 24 +++++++++++++++---------
1 file changed, 15 insertions(+), 9 deletions(-)
diff --git a/libavfilter/vf_tpad.c b/libavfilter/vf_tpad.c
index f0c065f0c3..88c3c99de4 100644
--- a/libavfilter/vf_tpad.c
+++ b/libavfilter/vf_tpad.c
@@ -27,6 +27,12 @@
#include "formats.h"
#include "drawutils.h"
+enum PadMode {
+ MODE_ADD = 0,
+ MODE_CLONE,
+ NB_MODE
+};
+
typedef struct TPadContext {
const AVClass *class;
int pad_start;
@@ -51,10 +57,10 @@ typedef struct TPadContext {
static const AVOption tpad_options[] = {
{ "start", "set the number of frames to delay input",
OFFSET(pad_start), AV_OPT_TYPE_INT, {.i64=0}, 0, INT_MAX, VF },
{ "stop", "set the number of frames to add after input finished",
OFFSET(pad_stop), AV_OPT_TYPE_INT, {.i64=0}, -1, INT_MAX, VF },
- { "start_mode", "set the mode of added frames to start",
OFFSET(start_mode), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, VF, "mode" },
- { "add", "add solid-color frames", 0,
AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, VF, "mode" },
- { "clone", "clone first/last frame", 0,
AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, VF, "mode" },
- { "stop_mode", "set the mode of added frames to end",
OFFSET(stop_mode), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, VF, "mode" },
+ { "start_mode", "set the mode of added frames to start",
OFFSET(start_mode), AV_OPT_TYPE_INT, {.i64=MODE_ADD}, 0, NB_MODE-1, VF, "mode" },
+ { "add", "add solid-color frames", 0,
AV_OPT_TYPE_CONST, {.i64=MODE_ADD}, 0, 0, VF, "mode" },
+ { "clone", "clone first/last frame", 0,
AV_OPT_TYPE_CONST, {.i64=MODE_CLONE}, 0, 0, VF, "mode" },