From 7848dd4c1c2a38e70f29dfce563caba6be7f12e2 Mon Sep 17 00:00:00 2001 From: alex Date: Tue, 19 Mar 2002 22:12:18 +0000 Subject: [PATCH] config vo if resolution changed (after decoded image read the dimensions out of lavc context) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5208 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/vd_ffmpeg.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c index f66d8c264c..e0d8ae7572 100644 --- a/libmpcodecs/vd_ffmpeg.c +++ b/libmpcodecs/vd_ffmpeg.c @@ -98,10 +98,17 @@ static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){ 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; }