Commit d21e496c authored by Paul B Mahol's avatar Paul B Mahol

lavfi/mptestsrc: use outlink->frame_count

Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent 30d40c9e
...@@ -52,7 +52,6 @@ enum test_type { ...@@ -52,7 +52,6 @@ enum test_type {
typedef struct MPTestContext { typedef struct MPTestContext {
const AVClass *class; const AVClass *class;
unsigned int frame_nb;
AVRational frame_rate; AVRational frame_rate;
int64_t pts, max_pts, duration; int64_t pts, max_pts, duration;
int hsub, vsub; int hsub, vsub;
...@@ -260,7 +259,6 @@ static av_cold int init(AVFilterContext *ctx) ...@@ -260,7 +259,6 @@ static av_cold int init(AVFilterContext *ctx)
test->max_pts = test->duration >= 0 ? test->max_pts = test->duration >= 0 ?
av_rescale_q(test->duration, AV_TIME_BASE_Q, av_inv_q(test->frame_rate)) : -1; av_rescale_q(test->duration, AV_TIME_BASE_Q, av_inv_q(test->frame_rate)) : -1;
test->frame_nb = 0;
test->pts = 0; test->pts = 0;
av_log(ctx, AV_LOG_VERBOSE, "rate:%d/%d duration:%f\n", av_log(ctx, AV_LOG_VERBOSE, "rate:%d/%d duration:%f\n",
...@@ -303,7 +301,7 @@ static int request_frame(AVFilterLink *outlink) ...@@ -303,7 +301,7 @@ static int request_frame(AVFilterLink *outlink)
AVFrame *picref; AVFrame *picref;
int w = WIDTH, h = HEIGHT, int w = WIDTH, h = HEIGHT,
cw = FF_CEIL_RSHIFT(w, test->hsub), ch = FF_CEIL_RSHIFT(h, test->vsub); cw = FF_CEIL_RSHIFT(w, test->hsub), ch = FF_CEIL_RSHIFT(h, test->vsub);
unsigned int frame = test->frame_nb; unsigned int frame = outlink->frame_count;
enum test_type tt = test->test; enum test_type tt = test->test;
int i; int i;
...@@ -338,7 +336,6 @@ static int request_frame(AVFilterLink *outlink) ...@@ -338,7 +336,6 @@ static int request_frame(AVFilterLink *outlink)
case TEST_RING2: ring2_test(picref->data[0], picref->linesize[0], frame%30); break; case TEST_RING2: ring2_test(picref->data[0], picref->linesize[0], frame%30); break;
} }
test->frame_nb++;
return ff_filter_frame(outlink, picref); return ff_filter_frame(outlink, picref);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment