changeset 6566:a48ad140c3af

support the 'align16' codec flag
author arpi
date Tue, 25 Jun 2002 22:29:32 +0000
parents 1075fe5fc8c3
children 00378d62ad75
files libmpcodecs/dec_video.c
diffstat 1 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/dec_video.c	Tue Jun 25 22:26:34 2002 +0000
+++ b/libmpcodecs/dec_video.c	Tue Jun 25 22:29:32 2002 +0000
@@ -162,6 +162,18 @@
 	    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");