avfilter/vf_separatefields: use the name 's' for the pointer to the private context

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
This commit is contained in:
Ganesh Ajjanagadde 2015-08-30 08:46:08 -07:00 committed by Paul B Mahol
parent 67e87f8050
commit 0169c4dc81

View File

@ -30,10 +30,10 @@ typedef struct {
static int config_props_output(AVFilterLink *outlink) static int config_props_output(AVFilterLink *outlink)
{ {
AVFilterContext *ctx = outlink->src; AVFilterContext *ctx = outlink->src;
SeparateFieldsContext *sf = ctx->priv; SeparateFieldsContext *s = ctx->priv;
AVFilterLink *inlink = ctx->inputs[0]; AVFilterLink *inlink = ctx->inputs[0];
sf->nb_planes = av_pix_fmt_count_planes(inlink->format); s->nb_planes = av_pix_fmt_count_planes(inlink->format);
if (inlink->h & 1) { if (inlink->h & 1) {
av_log(ctx, AV_LOG_ERROR, "height must be even\n"); av_log(ctx, AV_LOG_ERROR, "height must be even\n");
@ -64,19 +64,19 @@ static void extract_field(AVFrame *frame, int nb_planes, int type)
static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref) static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref)
{ {
AVFilterContext *ctx = inlink->dst; AVFilterContext *ctx = inlink->dst;
SeparateFieldsContext *sf = ctx->priv; SeparateFieldsContext *s = ctx->priv;
AVFilterLink *outlink = ctx->outputs[0]; AVFilterLink *outlink = ctx->outputs[0];
int ret; int ret;
inpicref->height = outlink->h; inpicref->height = outlink->h;
inpicref->interlaced_frame = 0; inpicref->interlaced_frame = 0;
if (!sf->second) { if (!s->second) {
goto clone; goto clone;
} else { } else {
AVFrame *second = sf->second; AVFrame *second = s->second;
extract_field(second, sf->nb_planes, second->top_field_first); extract_field(second, s->nb_planes, second->top_field_first);
if (second->pts != AV_NOPTS_VALUE && if (second->pts != AV_NOPTS_VALUE &&
inpicref->pts != AV_NOPTS_VALUE) inpicref->pts != AV_NOPTS_VALUE)
@ -88,12 +88,12 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref)
if (ret < 0) if (ret < 0)
return ret; return ret;
clone: clone:
sf->second = av_frame_clone(inpicref); s->second = av_frame_clone(inpicref);
if (!sf->second) if (!s->second)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
} }
extract_field(inpicref, sf->nb_planes, !inpicref->top_field_first); extract_field(inpicref, s->nb_planes, !inpicref->top_field_first);
if (inpicref->pts != AV_NOPTS_VALUE) if (inpicref->pts != AV_NOPTS_VALUE)
inpicref->pts *= 2; inpicref->pts *= 2;
@ -104,15 +104,15 @@ clone:
static int request_frame(AVFilterLink *outlink) static int request_frame(AVFilterLink *outlink)
{ {
AVFilterContext *ctx = outlink->src; AVFilterContext *ctx = outlink->src;
SeparateFieldsContext *sf = ctx->priv; SeparateFieldsContext *s = ctx->priv;
int ret; int ret;
ret = ff_request_frame(ctx->inputs[0]); ret = ff_request_frame(ctx->inputs[0]);
if (ret == AVERROR_EOF && sf->second) { if (ret == AVERROR_EOF && s->second) {
sf->second->pts *= 2; s->second->pts *= 2;
extract_field(sf->second, sf->nb_planes, sf->second->top_field_first); extract_field(s->second, s->nb_planes, s->second->top_field_first);
ret = ff_filter_frame(outlink, sf->second); ret = ff_filter_frame(outlink, s->second);
sf->second = 0; s->second = 0;
} }
return ret; return ret;