avfilter: properly set SAR for A->V filters

Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
Paul B Mahol 2017-06-13 15:07:36 +02:00
parent 3839580b71
commit f85cad799b
5 changed files with 8 additions and 2 deletions

View File

@ -166,6 +166,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
memset(outpicref->data[0] + i * outpicref->linesize[0], 0, outlink->w * 4);
outpicref->pts = insamples->pts;
outpicref->sample_aspect_ratio = (AVRational){1,1};
switch (insamples->format) {
case AV_SAMPLE_FMT_S16P:
for (ch = 0; ch < inlink->channels; ch++) {

View File

@ -246,6 +246,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
return AVERROR(ENOMEM);
}
s->outpicref->sample_aspect_ratio = (AVRational){1,1};
for (i = 0; i < outlink->h; i++)
memset(s->outpicref->data[0] + i * s->outpicref->linesize[0], 0, outlink->w * 4);
}

View File

@ -434,6 +434,7 @@ static int plot_freqs(AVFilterLink *inlink, AVFrame *in)
av_free(colors);
out->pts = in->pts;
out->sample_aspect_ratio = (AVRational){1,1};
return ff_filter_frame(outlink, out);
}

View File

@ -306,6 +306,7 @@ static int config_output(AVFilterLink *outlink)
outlink->w = s->w;
outlink->h = s->h;
outlink->sample_aspect_ratio = (AVRational){1,1};
if (s->legend) {
s->start_x = log10(inlink->sample_rate) * 25;
@ -422,7 +423,7 @@ static int config_output(AVFilterLink *outlink)
ff_get_video_buffer(outlink, outlink->w, outlink->h);
if (!outpicref)
return AVERROR(ENOMEM);
outlink->sample_aspect_ratio = (AVRational){1,1};
outpicref->sample_aspect_ratio = (AVRational){1,1};
for (i = 0; i < outlink->h; i++) {
memset(outpicref->data[0] + i * outpicref->linesize[0], 0, outlink->w);
memset(outpicref->data[1] + i * outpicref->linesize[1], 128, outlink->w);

View File

@ -269,6 +269,7 @@ static int config_video_output(AVFilterLink *outlink)
}
outlink->w = ebur128->w;
outlink->h = ebur128->h;
outlink->sample_aspect_ratio = (AVRational){1,1};
#define PAD 8
@ -299,7 +300,7 @@ static int config_video_output(AVFilterLink *outlink)
ff_get_video_buffer(outlink, outlink->w, outlink->h);
if (!outpicref)
return AVERROR(ENOMEM);
outlink->sample_aspect_ratio = (AVRational){1,1};
outpicref->sample_aspect_ratio = (AVRational){1,1};
/* init y references values (to draw LU lines) */
ebur128->y_line_ref = av_calloc(ebur128->graph.h + 1, sizeof(*ebur128->y_line_ref));