diff options
author | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-09-15 18:48:16 +0000 |
---|---|---|
committer | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-09-15 18:48:16 +0000 |
commit | 860a2241842bbf93c056c6b5bf0ca74efec542c4 (patch) | |
tree | 2002c87d1fc9d2f7b5ae6981f0e1cb6265875fb7 /libmpdemux/vcd_read_nbsd.h | |
parent | f81b1c60375759275dbdd6405110a478a42f6965 (diff) | |
download | mpv-860a2241842bbf93c056c6b5bf0ca74efec542c4.tar.bz2 mpv-860a2241842bbf93c056c6b5bf0ca74efec542c4.tar.xz |
removed obsolete VCD_CACHE hack
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7407 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux/vcd_read_nbsd.h')
-rw-r--r-- | libmpdemux/vcd_read_nbsd.h | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/libmpdemux/vcd_read_nbsd.h b/libmpdemux/vcd_read_nbsd.h index 0166facd08..a75eebbb36 100644 --- a/libmpdemux/vcd_read_nbsd.h +++ b/libmpdemux/vcd_read_nbsd.h @@ -148,51 +148,3 @@ vcd_read(int fd, char *mem) return VCD_SECTOR_DATA; } -#ifdef VCD_CACHE - -static int vcd_cache_size = 0; -static char *vcd_cache_data = NULL; -static int *vcd_cache_sectors = NULL; -static int vcd_cache_index = 0; -static int vcd_cache_current = -1; - -void -vcd_cache_init(int s) -{ - vcd_cache_size = s; - vcd_cache_sectors = malloc(s * sizeof(int)); - vcd_cache_data = malloc(s * VCD_SECTOR_SIZE); - memset(vcd_cache_sectors, 255, s * sizeof(int)); -} - -static inline void -vcd_cache_seek(int sect) -{ - vcd_cache_current = sect; -} - -int -vcd_cache_read(int fd, char *mem) -{ - int i; - char *vcd_buf; - for (i = 0; i < vcd_cache_size; i++) - if (vcd_cache_sectors[i] == vcd_cache_current) { - vcd_buf = &vcd_cache_data[i * VCD_SECTOR_SIZE]; - ++vcd_cache_current; - memcpy(mem, &vcd_buf[VCD_SECTOR_OFFS], VCD_SECTOR_DATA); - return VCD_SECTOR_DATA; - } - vcd_buf = &vcd_cache_data[vcd_cache_index * VCD_SECTOR_SIZE]; - vcd_cache_sectors[vcd_cache_index] = vcd_cache_current; - ++vcd_cache_index; - if (vcd_cache_index >= vcd_cache_size) - vcd_cache_index = 0; - vcd_set_msf(vcd_cache_current); - memcpy(vcd_buf, &vcd_entry_data.addr.msf, sizeof(vcd_entry_data.addr.msf)); - ++vcd_cache_current; - memcpy(mem, &vcd_buf[VCD_SECTOR_OFFS], VCD_SECTOR_DATA); - return VCD_SECTOR_DATA; -} -#endif - |