From e7d008251282e1b7c13ae7d41214fae5e87af097 Mon Sep 17 00:00:00 2001 From: arpi Date: Tue, 25 Jun 2002 22:29:32 +0000 Subject: [PATCH] support the 'align16' codec flag git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@6567 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/dec_video.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/libmpcodecs/dec_video.c b/libmpcodecs/dec_video.c index 59f044c358..37917a4608 100644 --- a/libmpcodecs/dec_video.c +++ b/libmpcodecs/dec_video.c @@ -162,6 +162,18 @@ int init_video(sh_video_t *sh_video,char* codecname,int vfm,int status){ continue; } // it's available, let's try to init! + if(sh_video->codec->flags & CODECS_FLAG_ALIGN16){ + // align width/height to n*16 + // FIXME: save orig w/h, and restore if codec init failed! + if(sh_video->bih){ + sh_video->disp_w=sh_video->bih->biWidth=(sh_video->bih->biWidth+15)&(~15); + sh_video->disp_h=sh_video->bih->biHeight=(sh_video->bih->biHeight+15)&(~15); + } else { + sh_video->disp_w=(sh_video->disp_w+15)&(~15); + sh_video->disp_h=(sh_video->disp_h+15)&(~15); + } + } + // init() mp_msg(MSGT_DECVIDEO,MSGL_INFO,"Opening video decoder: [%s] %s\n",mpvdec->info->short_name,mpvdec->info->name); if(!mpvdec->init(sh_video)){ mp_msg(MSGT_DECVIDEO,MSGL_INFO,"VDecoder init failed :(\n");