aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Visser <mjmvisser@gmail.com>2013-06-18 17:38:17 -0400
committerMark Visser <mjmvisser@gmail.com>2013-06-18 17:38:17 -0400
commit2090abcc436df92969634577c91ea1d1143d4533 (patch)
treef11120b0ed315a09ecebb2918c05e2a8286049c2
parent0defc77e9deb081c11c4b5cc44891c712e07b92b (diff)
downloadffmpeg-2090abcc436df92969634577c91ea1d1143d4533.tar.gz
add the start_number offset to var_values[VAR_N] directly, instead of adding it in func_frame_num
-rw-r--r--libavfilter/vf_drawtext.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c
index fcdf53a3ad..7cafafefc7 100644
--- a/libavfilter/vf_drawtext.c
+++ b/libavfilter/vf_drawtext.c
@@ -616,7 +616,7 @@ static int func_frame_num(AVFilterContext *ctx, AVBPrint *bp,
{
DrawTextContext *s = ctx->priv;
- av_bprintf(bp, "%d", (int)s->var_values[VAR_N]+s->start_number);
+ av_bprintf(bp, "%d", (int)s->var_values[VAR_N]);
return 0;
}
@@ -980,7 +980,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
if ((ret = load_textfile(ctx)) < 0)
return ret;
- s->var_values[VAR_N] = inlink->frame_count;
+ s->var_values[VAR_N] = inlink->frame_count+s->start_number;
s->var_values[VAR_T] = frame->pts == AV_NOPTS_VALUE ?
NAN : frame->pts * av_q2d(inlink->time_base);