summaryrefslogtreecommitdiff
path: root/libavfilter/vf_stack.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2015-11-26 09:56:43 +0100
committerPaul B Mahol <onemda@gmail.com>2015-11-26 10:02:00 +0100
commita33043023848495a7474fefb11c2ec2e69d47916 (patch)
treeaaf9c3dd2a4fe84c9fc3ad1216840ba258be5657 /libavfilter/vf_stack.c
parent9078a694f3fbc2f4db189c9796badbea632dd58d (diff)
avfilter/vf_stack: make it possible to stop with shortest stream
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavfilter/vf_stack.c')
-rw-r--r--libavfilter/vf_stack.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavfilter/vf_stack.c b/libavfilter/vf_stack.c
index c4bbd6166d..2fe371275d 100644
--- a/libavfilter/vf_stack.c
+++ b/libavfilter/vf_stack.c
@@ -33,6 +33,7 @@ typedef struct StackContext {
const AVClass *class;
const AVPixFmtDescriptor *desc;
int nb_inputs;
+ int shortest;
int is_vertical;
int nb_planes;
@@ -199,7 +200,7 @@ static int config_output(AVFilterLink *outlink)
in[i].time_base = inlink->time_base;
in[i].sync = 1;
in[i].before = EXT_STOP;
- in[i].after = EXT_INFINITY;
+ in[i].after = s->shortest ? EXT_STOP : EXT_INFINITY;
}
return ff_framesync_configure(&s->fs);
@@ -222,6 +223,7 @@ static av_cold void uninit(AVFilterContext *ctx)
#define FLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM
static const AVOption stack_options[] = {
{ "inputs", "set number of inputs", OFFSET(nb_inputs), AV_OPT_TYPE_INT, {.i64=2}, 2, INT_MAX, .flags = FLAGS },
+ { "shortest", "force termination when the shortest input terminates", OFFSET(shortest), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, .flags = FLAGS },
{ NULL },
};