changeset 5207:d337cc4ab0ee

config vo if resolution changed (after decoded image read the dimensions out of lavc context)
author alex
date Tue, 19 Mar 2002 22:12:18 +0000
parents 2ca5a9bfaa98
children b08228af4098
files libmpcodecs/vd_ffmpeg.c
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/vd_ffmpeg.c	Tue Mar 19 21:48:55 2002 +0000
+++ b/libmpcodecs/vd_ffmpeg.c	Tue Mar 19 22:12:18 2002 +0000
@@ -98,10 +98,17 @@
     if(ret<0) mp_msg(MSGT_DECVIDEO,MSGL_WARN, "Error while decoding frame!\n");
     if(!got_picture) return NULL;	// skipped image
     
+    if ((ctx->width != sh->disp_w) ||
+	(ctx->height != sh->disp_h))
+    {
+	if (mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_YV12))
+	    return NULL;
+    }	
+    
     mpi=mpcodecs_get_image(sh, MP_IMGTYPE_EXPORT, MP_IMGFLAG_PRESERVE,
 	ctx->width, ctx->height);
     if(!mpi){	// temporary!
-	printf("couldn't allocate image for cinepak codec\n");
+	printf("couldn't allocate image for codec\n");
 	return NULL;
     }