Commit 04c373c1 authored by Stefano Sabatini's avatar Stefano Sabatini

ffmpeg: prefer dec/enc over ost/ist->st->codec in do_video_out()

Compact code, improve readability.
parent a851fa7f
...@@ -1228,13 +1228,8 @@ static void do_video_out(AVFormatContext *s, ...@@ -1228,13 +1228,8 @@ static void do_video_out(AVFormatContext *s,
/* initialize a new scaler context */ /* initialize a new scaler context */
sws_freeContext(ost->img_resample_ctx); sws_freeContext(ost->img_resample_ctx);
sws_flags = av_get_int(sws_opts, "sws_flags", NULL); sws_flags = av_get_int(sws_opts, "sws_flags", NULL);
ost->img_resample_ctx = sws_getContext( ost->img_resample_ctx = sws_getContext(dec->width, dec->height, dec->pix_fmt,
ist->st->codec->width, enc->width, enc->height, enc->pix_fmt,
ist->st->codec->height,
ist->st->codec->pix_fmt,
ost->st->codec->width,
ost->st->codec->height,
ost->st->codec->pix_fmt,
sws_flags, NULL, NULL, NULL); sws_flags, NULL, NULL, NULL);
if (ost->img_resample_ctx == NULL) { if (ost->img_resample_ctx == NULL) {
fprintf(stderr, "Cannot get resampling context\n"); fprintf(stderr, "Cannot get resampling context\n");
......
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