changeset 25365:b57179296e5a

Only print one track info when exactly seeking to the beginning of a track.
author ulion
date Fri, 14 Dec 2007 15:39:46 +0000
parents fec8936c8079
children 42c182ff5066
files stream/stream_cdda.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/stream/stream_cdda.c	Fri Dec 14 08:39:45 2007 +0000
+++ b/stream/stream_cdda.c	Fri Dec 14 15:39:46 2007 +0000
@@ -328,6 +328,7 @@
   cd_track_t *cd_track;
   int sec;
   int current_track=0, seeked_track=0;
+  int seek_to_track = 0;
   int i;
   
   s->pos = newpos;
@@ -347,10 +348,11 @@
 	}
 	if( sec>=p->cd->disc_toc[i].dwStartSector && sec<p->cd->disc_toc[i+1].dwStartSector ) {
 		seeked_track = i;
+		seek_to_track = sec == p->cd->disc_toc[i].dwStartSector;
 	}
   }
 //printf("current: %d, seeked: %d\n", current_track, seeked_track);
-	if( current_track!=seeked_track ) {
+	if (current_track != seeked_track && !seek_to_track) {
 //printf("Track %d, sector=%d\n", seeked_track, sec);
 		  cd_track = cd_info_get_track(p->cd_info, seeked_track+1);
 		  if( cd_track!=NULL ) {