mirror of https://github.com/mpv-player/mpv
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
This commit is contained in:
parent
9ed76eba4b
commit
7848dd4c1c
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue