fftools/ffmpeg: move a misplaced assignment

Changing AVCodecContext.sample_aspect_ratio after the encoder was opened
is by itself questionable, but if anywhere it belongs in encoding rather
than filtering code.
This commit is contained in:
Anton Khirnov 2023-04-11 09:34:29 +02:00
parent a0452ee837
commit 4fc513b5e3
2 changed files with 3 additions and 3 deletions

View File

@ -711,9 +711,6 @@ static int reap_filters(int flush)
switch (av_buffersink_get_type(filter)) {
case AVMEDIA_TYPE_VIDEO:
if (!ost->frame_aspect_ratio.num)
enc->sample_aspect_ratio = filtered_frame->sample_aspect_ratio;
enc_frame(ost, filtered_frame);
break;
case AVMEDIA_TYPE_AUDIO:

View File

@ -653,6 +653,9 @@ static int encode_frame(OutputFile *of, OutputStream *ost, AVFrame *frame)
av_ts2str(frame->pts), av_ts2timestr(frame->pts, &enc->time_base),
enc->time_base.num, enc->time_base.den);
}
if (frame->sample_aspect_ratio.num && !ost->frame_aspect_ratio.num)
enc->sample_aspect_ratio = frame->sample_aspect_ratio;
}
update_benchmark(NULL);