From ee104580c5b83e0fe697a66c2638b56d584c0081 Mon Sep 17 00:00:00 2001 From: Tobias Rapp Date: Thu, 7 Apr 2016 10:20:53 +0200 Subject: avfilter/vf_drawtext: add optional default value to metadata function Signed-off-by: Tobias Rapp --- libavfilter/vf_drawtext.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libavfilter/vf_drawtext.c') diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c index 1ef3ecb31f..6b9af5b425 100644 --- a/libavfilter/vf_drawtext.c +++ b/libavfilter/vf_drawtext.c @@ -860,6 +860,8 @@ static int func_metadata(AVFilterContext *ctx, AVBPrint *bp, if (e && e->value) av_bprintf(bp, "%s", e->value); + else if (argc >= 2) + av_bprintf(bp, "%s", argv[1]); return 0; } @@ -975,7 +977,7 @@ static const struct drawtext_function { { "localtime", 0, 1, 'L', func_strftime }, { "frame_num", 0, 0, 0, func_frame_num }, { "n", 0, 0, 0, func_frame_num }, - { "metadata", 1, 1, 0, func_metadata }, + { "metadata", 1, 2, 0, func_metadata }, }; static int eval_function(AVFilterContext *ctx, AVBPrint *bp, char *fct, -- cgit v1.2.3