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

avfilter: properly set SAR for A->V filters

Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent 3839580b
......@@ -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++) {
......
......@@ -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);
}
......
......@@ -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);
}
......
......@@ -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);
......
......@@ -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));
......
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