Commit 225341b2 authored by Paul B Mahol's avatar Paul B Mahol

avfilter/vf_stack: always copy SAR from first input

Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent 00d454ed
...@@ -105,6 +105,7 @@ static int process_frame(FFFrameSync *fs) ...@@ -105,6 +105,7 @@ static int process_frame(FFFrameSync *fs)
if (!out) if (!out)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
out->pts = av_rescale_q(s->fs.pts, s->fs.time_base, outlink->time_base); out->pts = av_rescale_q(s->fs.pts, s->fs.time_base, outlink->time_base);
out->sample_aspect_ratio = outlink->sample_aspect_ratio;
for (i = 0; i < s->nb_inputs; i++) { for (i = 0; i < s->nb_inputs; i++) {
AVFilterLink *inlink = ctx->inputs[i]; AVFilterLink *inlink = ctx->inputs[i];
...@@ -147,6 +148,7 @@ static int config_output(AVFilterLink *outlink) ...@@ -147,6 +148,7 @@ static int config_output(AVFilterLink *outlink)
StackContext *s = ctx->priv; StackContext *s = ctx->priv;
AVRational time_base = ctx->inputs[0]->time_base; AVRational time_base = ctx->inputs[0]->time_base;
AVRational frame_rate = ctx->inputs[0]->frame_rate; AVRational frame_rate = ctx->inputs[0]->frame_rate;
AVRational sar = ctx->inputs[0]->sample_aspect_ratio;
int height = ctx->inputs[0]->h; int height = ctx->inputs[0]->h;
int width = ctx->inputs[0]->w; int width = ctx->inputs[0]->w;
FFFrameSyncIn *in; FFFrameSyncIn *in;
...@@ -179,6 +181,7 @@ static int config_output(AVFilterLink *outlink) ...@@ -179,6 +181,7 @@ static int config_output(AVFilterLink *outlink)
outlink->h = height; outlink->h = height;
outlink->time_base = time_base; outlink->time_base = time_base;
outlink->frame_rate = frame_rate; outlink->frame_rate = frame_rate;
outlink->sample_aspect_ratio = sar;
if ((ret = ff_framesync_init(&s->fs, ctx, s->nb_inputs)) < 0) if ((ret = ff_framesync_init(&s->fs, ctx, s->nb_inputs)) < 0)
return ret; return ret;
......
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