[Mplayer-cvslog] CVS: main/libmpdemux stream.c,1.46,1.47 cdda.c,1.3,1.4 demux_rawaudio.c,1.4,1.5

Arpi of Ize arpi at mplayerhq.hu
Sun Dec 22 18:23:04 CET 2002


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

Modified Files:
	stream.c cdda.c demux_rawaudio.c 
Log Message:
CDDA seeking fixed


Index: stream.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/stream.c,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -r1.46 -r1.47
--- stream.c	4 Dec 2002 21:30:24 -0000	1.46
+++ stream.c	22 Dec 2002 17:22:48 -0000	1.47
@@ -130,6 +130,10 @@
     newpos=(pos/VCD_SECTOR_DATA)*VCD_SECTOR_DATA;break;
   case STREAMTYPE_DVD:
     newpos=pos/2048; newpos*=2048; break;
+#ifdef HAVE_CDDA
+  case STREAMTYPE_CDDA:
+    newpos=(pos/VCD_SECTOR_SIZE)*VCD_SECTOR_SIZE;break;
+#endif
   }
 
 if(verbose>=3){

Index: cdda.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/cdda.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- cdda.c	23 Oct 2002 17:21:00 -0000	1.3
+++ cdda.c	22 Dec 2002 17:22:48 -0000	1.4
@@ -204,14 +204,15 @@
   int i;
 
   sec = s->pos/CD_FRAMESIZE_RAW;
-//printf("pos: %d, sec: %d ## %d\n", s->pos, sec, s->pos/CD_FRAMESIZE_RAW);
-//printf("sector: %d\n", p->sector );
+//printf("pos: %d, sec: %d ## %d\n", (int)s->pos, (int)sec, CD_FRAMESIZE_RAW);
+//printf("sector: %d  new: %d\n", p->sector, sec );
  
   for(i=0;i<p->cd->tracks;i++){
-	if( p->sector>p->cd->disc_toc[i].dwStartSector && p->sector<p->cd->disc_toc[i+1].dwStartSector ) {
+        printf("trk #%d: %d .. %d\n",i,p->cd->disc_toc[i].dwStartSector,p->cd->disc_toc[i+1].dwStartSector);
+	if( p->sector>=p->cd->disc_toc[i].dwStartSector && p->sector<p->cd->disc_toc[i+1].dwStartSector ) {
 		current_track = i;
 	}
-	if( sec>p->cd->disc_toc[i].dwStartSector && sec<p->cd->disc_toc[i+1].dwStartSector ) {
+	if( sec>=p->cd->disc_toc[i].dwStartSector && sec<p->cd->disc_toc[i+1].dwStartSector ) {
 		seeked_track = i;
 	}
   }
@@ -224,16 +225,17 @@
 		  }
 
 	}
- 
+#if 0
   if(sec < p->start_sector)
     sec = p->start_sector;
   else if(sec > p->end_sector)
     sec = p->end_sector;
+#endif
 
   p->sector = sec;
 //  s->pos = sec*CD_FRAMESIZE_RAW;
 
-//printf("seek: %d, sec: %d\n", s->pos, sec);
+//printf("seek: %d, sec: %d\n", (int)s->pos, sec);
   paranoia_seek(p->cdp,sec,SEEK_SET);
 
 }

Index: demux_rawaudio.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_rawaudio.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- demux_rawaudio.c	14 Dec 2002 17:56:06 -0000	1.4
+++ demux_rawaudio.c	22 Dec 2002 17:22:48 -0000	1.5
@@ -87,5 +87,7 @@
 
   pos -= (pos % (sh_audio->channels * sh_audio->samplesize) );
   stream_seek(s,pos);
+  sh_audio->delay=pos / (float)(sh_audio->wf->nAvgBytesPerSec);
   resync_audio_stream(sh_audio);
+//  printf("demux_rawaudio: streamtell=%d\n",(int)stream_tell(demuxer->stream));
 }




More information about the MPlayer-cvslog mailing list