aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn A. Serre <gaserre@spiresoftware.com>2007-08-03 18:44:44 +0000
committerAlex Beregszaszi <alex@rtfs.hu>2007-08-03 18:44:44 +0000
commit1a3f0ca2e051f560ca91d196d36dbd0b397d0912 (patch)
tree5d7dfe52947074d3d616ba3fff351dd7261df04e
parent3e5008a922900fcc39f1d8e9d9bea489876914b1 (diff)
downloadffmpeg-1a3f0ca2e051f560ca91d196d36dbd0b397d0912.tar.gz
Use getCachedContext instead getContext to support resolution change. Patch by Glenn A. Serre
Originally committed as revision 9873 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--ffplay.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/ffplay.c b/ffplay.c
index 248d66f79b..e849f89f23 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -1252,8 +1252,7 @@ static int queue_picture(VideoState *is, AVFrame *src_frame, double pts)
pict.linesize[0] = vp->bmp->pitches[0];
pict.linesize[1] = vp->bmp->pitches[2];
pict.linesize[2] = vp->bmp->pitches[1];
- if (img_convert_ctx == NULL) {
- img_convert_ctx = sws_getContext(is->video_st->codec->width,
+ img_convert_ctx = sws_getCachedContext(img_convert_ctx, is->video_st->codec->width,
is->video_st->codec->height, is->video_st->codec->pix_fmt,
is->video_st->codec->width, is->video_st->codec->height,
dst_pix_fmt, sws_flags, NULL, NULL, NULL);
@@ -1261,7 +1260,6 @@ static int queue_picture(VideoState *is, AVFrame *src_frame, double pts)
fprintf(stderr, "Cannot initialize the conversion context\n");
exit(1);
}
- }
sws_scale(img_convert_ctx, src_frame->data, src_frame->linesize,
0, is->video_st->codec->height, pict.data, pict.linesize);
/* update the bitmap content */