summaryrefslogtreecommitdiff
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorStefano Sabatini <stefano.sabatini-lala@poste.it>2011-05-06 11:14:15 +0200
committerStefano Sabatini <stefano.sabatini-lala@poste.it>2011-05-07 12:03:58 +0200
commit04c373c1e98c2f62632eb3cd12726945173225ea (patch)
tree9fd84929bc3a994b021ebb01cb69365e6a42d5fa /ffmpeg.c
parenta851fa7fecc7dbf681b046c8ddcd46bd842c792f (diff)
ffmpeg: prefer dec/enc over ost/ist->st->codec in do_video_out()
Compact code, improve readability.
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index f9f08cd543..ae2c32986e 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1228,14 +1228,9 @@ static void do_video_out(AVFormatContext *s,
/* initialize a new scaler context */
sws_freeContext(ost->img_resample_ctx);
sws_flags = av_get_int(sws_opts, "sws_flags", NULL);
- ost->img_resample_ctx = sws_getContext(
- ist->st->codec->width,
- 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);
+ ost->img_resample_ctx = sws_getContext(dec->width, dec->height, dec->pix_fmt,
+ enc->width, enc->height, enc->pix_fmt,
+ sws_flags, NULL, NULL, NULL);
if (ost->img_resample_ctx == NULL) {
fprintf(stderr, "Cannot get resampling context\n");
ffmpeg_exit(1);