[Mplayer-cvslog] CVS: main/libmpdemux open.c,1.54,1.55 stream.c,1.41,1.42 stream.h,1.47,1.48 vcd_read.h,1.11,1.12 vcd_read_fbsd.h,1.4,1.5 vcd_read_nbsd.h,1.1,1.2

Arpi of Ize arpi at mplayerhq.hu
Sun Sep 15 20:48:33 CEST 2002


Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var/tmp.root/cvs-serv13493

Modified Files:
	open.c stream.c stream.h vcd_read.h vcd_read_fbsd.h 
	vcd_read_nbsd.h 
Log Message:
removed obsolete VCD_CACHE hack


Index: open.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/open.c,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -r1.54 -r1.55
--- open.c	8 Sep 2002 23:00:01 -0000	1.54
+++ open.c	15 Sep 2002 18:48:16 -0000	1.55
@@ -83,9 +83,6 @@
 stream_t* stream=NULL;
 int f=-1;
 off_t len;
-#ifdef VCD_CACHE
-int vcd_cache_size=128;
-#endif
 #ifdef __FreeBSD__
 int bsize = VCD_SECTOR_SIZE;
 #endif
@@ -111,9 +108,6 @@
   if(ret<0){ mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_ErrTrackSelect " (seek)\n");return NULL;}
 //  seek_to_byte+=ret;
   mp_msg(MSGT_OPEN,MSGL_V,"VCD start byte position: 0x%X  end: 0x%X\n",ret,ret2);
-#ifdef VCD_CACHE
-  vcd_cache_init(vcd_cache_size);
-#endif
 #ifdef __FreeBSD__
   if (ioctl (f, CDRIOCSETBLOCKSIZE, &bsize) == -1) {
         perror ( "Error in CDRIOCSETBLOCKSIZE");

Index: stream.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/stream.c,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -r1.41 -r1.42
--- stream.c	4 Aug 2002 13:35:25 -0000	1.41
+++ stream.c	15 Sep 2002 18:48:16 -0000	1.42
@@ -69,12 +69,8 @@
 #endif
 #ifdef HAVE_VCD
   case STREAMTYPE_VCD:
-#ifdef VCD_CACHE
-    len=vcd_cache_read(s->fd,s->buffer);break;
-#else
     len=vcd_read(s->fd,s->buffer);break;
 #endif
-#endif
 #ifdef USE_DVDNAV
   case STREAMTYPE_DVDNAV: {
     dvdnav_stream_read((dvdnav_priv_t*)s->priv,s->buffer,&len);
@@ -92,13 +88,6 @@
     break;
   }
 #endif
-#ifdef USE_TV
-  case STREAMTYPE_TV:
-  {
-    len = 0;
-    break;
-  }
-#endif
   case STREAMTYPE_DS:
     len = demux_read_data((demux_stream_t*)s->priv,s->buffer,STREAM_BUFFER_SIZE);
     break;
@@ -154,11 +143,7 @@
 #ifdef HAVE_VCD
   case STREAMTYPE_VCD:
     s->pos=newpos; // real seek
-#ifdef VCD_CACHE
-    vcd_cache_seek(s->pos/VCD_SECTOR_DATA);
-#else
     vcd_set_msf(s->pos/VCD_SECTOR_DATA);
-#endif
     break;
 #endif
 #ifdef HAVE_CDDA

Index: stream.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/stream.h,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -r1.47 -r1.48
--- stream.h	8 Sep 2002 23:00:01 -0000	1.47
+++ stream.h	15 Sep 2002 18:48:16 -0000	1.48
@@ -30,10 +30,6 @@
 int vcd_seek_to_track(int fd,int track);
 void vcd_read_toc(int fd);
 
-#ifdef VCD_CACHE
-void vcd_cache_init(int s);
-#endif
-
 typedef struct {
   int fd;
   int type; // 0=file 1=VCD

Index: vcd_read.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/vcd_read.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- vcd_read.h	1 Dec 2001 23:40:24 -0000	1.11
+++ vcd_read.h	15 Sep 2002 18:48:16 -0000	1.12
@@ -199,61 +199,6 @@
 }
 #endif	/*sun*/
 
-
-//================== VCD CACHE =======================
-#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; // index to first free (or oldest) cache sector
-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){
-      // found in the cache! :)
-      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;
-    }
-  // NEW cache entry:
-  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;
-  // read data!
-  vcd_set_msf(vcd_cache_current);
-#if	defined(linux) || defined(__bsdi__)
-  memcpy(vcd_buf,&vcd_entry.cdte_addr.msf,sizeof(struct cdrom_msf));
-  if(ioctl(fd,CDROMREADRAW,vcd_buf)==-1) return 0; // EOF?
-  memcpy(mem,&vcd_buf[VCD_SECTOR_OFFS],VCD_SECTOR_DATA);
-#elif	defined(sun)
-  {
-    int offset;
-    if (sun_vcd_read(fd, &offset) <= 0) return 0;
-    memcpy(mem,&vcd_buf[offset],VCD_SECTOR_DATA);
-  }
-#endif
-  ++vcd_cache_current;
-  return VCD_SECTOR_DATA;
-}
-#endif
-
 #else /* linux || sun || __bsdi__ */
 
 #error vcd is not yet supported on this arch...

Index: vcd_read_fbsd.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/vcd_read_fbsd.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- vcd_read_fbsd.h	13 Jul 2001 08:44:51 -0000	1.4
+++ vcd_read_fbsd.h	15 Sep 2002 18:48:16 -0000	1.5
@@ -96,48 +96,3 @@
       return VCD_SECTOR_DATA;
 }
 
-//================== VCD CACHE =======================
-#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; // index to first free (or oldest) cache sector
-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){
-      // found in the cache! :)
-      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;
-    }
-  // NEW cache entry:
-  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;
-  // read data!
-  vcd_set_msf(vcd_cache_current);
-  memcpy(vcd_buf,&vcd_entry.entry.addr.msf,sizeof(struct cdrom_msf));
-/*  if(ioctl(fd,CDROMREADRAW,vcd_buf)==-1) return 0; */ // EOF?
-  ++vcd_cache_current;
-  memcpy(mem,&vcd_buf[VCD_SECTOR_OFFS],VCD_SECTOR_DATA);
-  return VCD_SECTOR_DATA;
-}
-
-#endif

Index: vcd_read_nbsd.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/vcd_read_nbsd.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- vcd_read_nbsd.h	27 Apr 2002 22:42:26 -0000	1.1
+++ vcd_read_nbsd.h	15 Sep 2002 18:48:16 -0000	1.2
@@ -148,51 +148,3 @@
   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
-




More information about the MPlayer-cvslog mailing list