avfilter/vf_stack: always copy SAR from first input
authorPaul B Mahol <onemda@gmail.com>
Sat, 2 Dec 2017 22:29:49 +0000 (23:29 +0100)
committerPaul B Mahol <onemda@gmail.com>
Sat, 2 Dec 2017 22:29:49 +0000 (23:29 +0100)
Signed-off-by: Paul B Mahol <onemda@gmail.com>
libavfilter/vf_stack.c

index 2467302..b2b8c68 100644 (file)
@@ -105,6 +105,7 @@ static int process_frame(FFFrameSync *fs)
     if (!out)
         return AVERROR(ENOMEM);
     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++) {
         AVFilterLink *inlink = ctx->inputs[i];
@@ -147,6 +148,7 @@ static int config_output(AVFilterLink *outlink)
     StackContext *s = ctx->priv;
     AVRational time_base = ctx->inputs[0]->time_base;
     AVRational frame_rate = ctx->inputs[0]->frame_rate;
+    AVRational sar = ctx->inputs[0]->sample_aspect_ratio;
     int height = ctx->inputs[0]->h;
     int width = ctx->inputs[0]->w;
     FFFrameSyncIn *in;
@@ -179,6 +181,7 @@ static int config_output(AVFilterLink *outlink)
     outlink->h          = height;
     outlink->time_base  = time_base;
     outlink->frame_rate = frame_rate;
+    outlink->sample_aspect_ratio = sar;
 
     if ((ret = ff_framesync_init(&s->fs, ctx, s->nb_inputs)) < 0)
         return ret;