summaryrefslogtreecommitdiffstats
path: root/libmpcodecs/vd_ffmpeg.c
diff options
context:
space:
mode:
authoralex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-03-19 22:12:18 +0000
committeralex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-03-19 22:12:18 +0000
commit7848dd4c1c2a38e70f29dfce563caba6be7f12e2 (patch)
tree2b2461e8cb7dc2ea35f29a49945649e5771412b2 /libmpcodecs/vd_ffmpeg.c
parent9ed76eba4bd653bbd8c198787a44893c69881875 (diff)
downloadmpv-7848dd4c1c2a38e70f29dfce563caba6be7f12e2.tar.bz2
mpv-7848dd4c1c2a38e70f29dfce563caba6be7f12e2.tar.xz
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
Diffstat (limited to 'libmpcodecs/vd_ffmpeg.c')
-rw-r--r--libmpcodecs/vd_ffmpeg.c9
1 files changed, 8 insertions, 1 deletions
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;
}