diff libmpcodecs/vd_ffmpeg.c @ 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 3dcbf67c0de0
children 9a2e8b32db2a
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;
     }