[FFmpeg-cvslog] r9873 - trunk/ffplay.c

alex subversion
Fri Aug 3 20:44:44 CEST 2007


Author: alex
Date: Fri Aug  3 20:44:44 2007
New Revision: 9873

Log:
Use getCachedContext instead getContext to support resolution change. Patch by Glenn A. Serre

Modified:
   trunk/ffplay.c

Modified: trunk/ffplay.c
==============================================================================
--- trunk/ffplay.c	(original)
+++ trunk/ffplay.c	Fri Aug  3 20:44:44 2007
@@ -1252,8 +1252,7 @@ static int queue_picture(VideoState *is,
         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,
                 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 */




More information about the ffmpeg-cvslog mailing list