# HG changeset patch # User arpi # Date 997923868 0 # Node ID 4b0046db8e64c55a27acaf3f39fc0a2d76d63be6 # Parent d4cd08b066651c979895d8d1bfa424b26b243c84 alloc frame buffer for directshow codec - requires for avifile sync diff -r d4cd08b06665 -r 4b0046db8e64 dec_video.c --- a/dec_video.c Thu Aug 16 01:03:51 2001 +0000 +++ b/dec_video.c Thu Aug 16 01:04:28 2001 +0000 @@ -171,6 +171,7 @@ // GUI_MSG( mplCompileWithoutDSSupport ) // exit(1); #else + int bpp; if(DS_VideoDecoder_Open(sh_video->codec->dll,&sh_video->codec->guid, sh_video->bih, 0, &sh_video->our_out_buffer)){ // if(DS_VideoDecoder_Open(sh_video->codec->dll,&sh_video->codec->guid, sh_video->bih, 0, NULL)){ printf("ERROR: Couldn't open required DirectShow codec: %s\n",sh_video->codec->dll); @@ -192,15 +193,20 @@ switch(out_fmt){ case IMGFMT_YUY2: case IMGFMT_UYVY: + bpp=16; DS_VideoDecoder_SetDestFmt(16,out_fmt);break; // packed YUV case IMGFMT_YV12: case IMGFMT_I420: case IMGFMT_IYUV: + bpp=12; DS_VideoDecoder_SetDestFmt(12,out_fmt);break; // planar YUV default: + bpp=((out_fmt&255)+7)&(~7); DS_VideoDecoder_SetDestFmt(out_fmt&255,0); // RGB/BGR } + sh_video->our_out_buffer = shmem_alloc(sh_video->disp_w*sh_video->disp_h*bpp/8); // FIXME!!! + DS_VideoDecoder_Start(); DS_SetAttr_DivX("Quality",divx_quality);