[Mplayer-cvslog] CVS: 0_90/libmpdemux cdda.c,1.8,1.9

Arpi of Ize arpi at mplayerhq.hu
Sun Mar 23 01:20:31 CET 2003


Update of /cvsroot/mplayer/0_90/libmpdemux
In directory mail:/var/tmp.root/cvs-serv25681

Modified Files:
	cdda.c 
Log Message:
backport: seeking fix


Index: cdda.c
===================================================================
RCS file: /cvsroot/mplayer/0_90/libmpdemux/cdda.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- cdda.c	15 Jan 2003 17:50:21 -0000	1.8
+++ cdda.c	23 Mar 2003 00:20:29 -0000	1.9
@@ -182,8 +182,10 @@
   s->pos = p->sector*CD_FRAMESIZE_RAW;
   memcpy(s->buffer,buf,CD_FRAMESIZE_RAW);
 
-  if(p->sector == p->end_sector)
+  if((p->sector < p->start_sector) || (p->sector >= p->end_sector)) {
     s->eof = 1;
+    return 0;
+  }
 
   for(i=0;i<p->cd->tracks;i++){
 	  if(p->cd->disc_toc[i].dwStartSector==p->sector-1) {
@@ -206,6 +208,11 @@
   int sec;
   int current_track=0, seeked_track=0;
   int i;
+  
+  if(s->pos < 0) {
+    s->eof = 1;
+    return;
+  }
 
   sec = s->pos/CD_FRAMESIZE_RAW;
 //printf("pos: %d, sec: %d ## %d\n", (int)s->pos, (int)sec, CD_FRAMESIZE_RAW);



More information about the MPlayer-cvslog mailing list