[Mplayer-cvslog] CVS: main stream.c,1.13,1.14

Arpi of Ize arpi at mplayer.dev.hu
Mon Aug 20 22:18:29 CEST 2001


Update of /cvsroot/mplayer/main
In directory mplayer:/var/tmp.root/cvs-serv32481

Modified Files:
	stream.c 
Log Message:
seeking in DVD

Index: stream.c
===================================================================
RCS file: /cvsroot/mplayer/main/stream.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- stream.c	1 Aug 2001 09:14:02 -0000	1.13
+++ stream.c	20 Aug 2001 20:18:27 -0000	1.14
@@ -20,6 +20,11 @@
 #include "vcd_read.c"
 #endif
 
+#ifdef USE_DVDREAD
+int dvd_read_sector(void* d,void* p2);
+void dvd_seek(void* d,off_t pos);
+#endif
+
 //=================== STREAMER =========================
 
 int stream_fill_buffer(stream_t *s){
@@ -35,6 +40,16 @@
 #else
     len=vcd_read(s->fd,s->buffer);break;
 #endif
+#ifdef USE_DVDREAD
+  case STREAMTYPE_DVD: {
+    off_t pos=dvd_read_sector(s->priv,s->buffer);
+    if(pos>=0){
+	len=2048; // full sector
+	s->pos=2048*pos-len;
+    } else len=-1; // error
+    break;
+  }
+#endif
   default: len=0;
   }
   if(len<=0){ s->eof=1; s->buf_pos=s->buf_len=0; return 0; }
@@ -72,6 +87,8 @@
 #endif
   case STREAMTYPE_VCD:
     newpos=(pos/VCD_SECTOR_DATA)*VCD_SECTOR_DATA;break;
+  case STREAMTYPE_DVD:
+    newpos=pos/2048; newpos*=2048; break;
   }
 
   pos-=newpos;
@@ -90,6 +107,12 @@
     vcd_set_msf(s->pos/VCD_SECTOR_DATA);
 #endif
     break;
+#ifdef USE_DVDREAD
+  case STREAMTYPE_DVD:
+    s->pos=newpos; // real seek
+    dvd_seek(s->priv,s->pos/2048);
+    break;
+#endif
   case STREAMTYPE_STREAM:
     //s->pos=newpos; // real seek
     if(newpos<s->pos){




More information about the MPlayer-cvslog mailing list