[MPlayer-cvslog] r25410 - trunk/stream/stream_cdda.c

ulion subversion at mplayerhq.hu
Sat Dec 15 16:38:38 CET 2007


Author: ulion
Date: Sat Dec 15 16:38:38 2007
New Revision: 25410

Log:
Make the end_sector accessable (it should be).


Modified:
   trunk/stream/stream_cdda.c

Modified: trunk/stream/stream_cdda.c
==============================================================================
--- trunk/stream/stream_cdda.c	(original)
+++ trunk/stream/stream_cdda.c	Sat Dec 15 16:38:38 2007
@@ -261,7 +261,7 @@ static int open_cdda(stream_t *st,int m,
 
   st->priv = priv;
   st->start_pos = priv->start_sector*CD_FRAMESIZE_RAW;
-  st->end_pos = priv->end_sector*CD_FRAMESIZE_RAW;
+  st->end_pos = (priv->end_sector + 1) * CD_FRAMESIZE_RAW;
   st->type = STREAMTYPE_CDDA;
   st->sector_size = CD_FRAMESIZE_RAW;
 
@@ -289,6 +289,11 @@ static int fill_buffer(stream_t* s, char
   int16_t * buf;
   int i;
   
+  if((p->sector < p->start_sector) || (p->sector > p->end_sector)) {
+    s->eof = 1;
+    return 0;
+  }
+
   buf = paranoia_read(p->cdp,cdparanoia_callback);
   if (!buf)
     return 0;
@@ -302,11 +307,6 @@ static int fill_buffer(stream_t* s, char
   s->pos = p->sector*CD_FRAMESIZE_RAW;
   memcpy(buffer,buf,CD_FRAMESIZE_RAW);
 
-  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) {
 		  cd_track = cd_info_get_track(p->cd_info, i+1);
@@ -333,7 +333,7 @@ static int seek(stream_t* s,off_t newpos
   
   s->pos = newpos;
   sec = s->pos/CD_FRAMESIZE_RAW;
-  if (s->pos < 0 || sec >= p->end_sector) {
+  if (s->pos < 0 || sec > p->end_sector) {
     s->eof = 1;
     return 0;
   }



More information about the MPlayer-cvslog mailing list