X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavfilter%2Fvf_drawtext.c;h=214aef0f2f5670311c8e303c6a5143a93b7f5616;hb=9bbed8645a6b7137d520041d759f3cc0df0529b9;hp=1ef3ecb31f21cb162b010c63badcda2ad5c7de71;hpb=f1e7c42f08d0370b8d47c2ca3d2c043d19d3fa8a;p=ffmpeg diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c index 1ef3ecb31f2..214aef0f2f5 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, @@ -1222,7 +1224,9 @@ static int draw_text(AVFilterContext *ctx, AVFrame *frame, dummy.code = code; glyph = av_tree_find(s->glyphs, &dummy, glyph_cmp, NULL); if (!glyph) { - load_glyph(ctx, &glyph, code); + ret = load_glyph(ctx, &glyph, code); + if (ret < 0) + return ret; } y_min = FFMIN(glyph->bbox.yMin, y_min);