# HG changeset patch # User michael # Date 1014913258 0 # Node ID abe1a2edb422c21def7a2c055beb785f341592c2 # Parent 904cc3813582f55fb8753f838469c5b65f052031 use 4 buffers, fallback to fewer buffers if the video ram isnt large enough diff -r 904cc3813582 -r abe1a2edb422 vidix/drivers/mach64_vid.c --- a/vidix/drivers/mach64_vid.c Thu Feb 28 13:50:09 2002 +0000 +++ b/vidix/drivers/mach64_vid.c Thu Feb 28 16:20:58 2002 +0000 @@ -843,12 +843,18 @@ int vixConfigPlayback(vidix_playback_t *info) { if(!is_supported_fourcc(info->fourcc)) return ENOSYS; - if(info->num_frames>3) info->num_frames=3; //more than 3 make no sense at the moment but they do work mach64_compute_framesize(info); - mach64_overlay_offset = mach64_ram_size - info->frame_size*info->num_frames; - mach64_overlay_offset &= 0xffff0000; - if(mach64_overlay_offset < 0) return EINVAL; + + if(info->num_frames>4) info->num_frames=4; + for(;info->num_frames>0; info->num_frames--) + { + mach64_overlay_offset = mach64_ram_size - info->frame_size*info->num_frames; + mach64_overlay_offset &= 0xffff0000; + if(mach64_overlay_offset>0) break; + } + if(info->num_frames <= 0) return EINVAL; + info->dga_addr = (char *)mach64_mem_base + mach64_overlay_offset; mach64_vid_init_video(info); return 0;