changeset 23269:6606c4f5c78c

Fix track info being read for the wrong track introduced in r20598 Patch by kiriuja (mplayer-patches <at> en-directo net)
author reimar
date Thu, 10 May 2007 11:43:39 +0000
parents 686107ddaab5
children f094c9256137
files stream/stream_cddb.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/stream/stream_cddb.c	Thu May 10 11:39:58 2007 +0000
+++ b/stream/stream_cddb.c	Thu May 10 11:43:39 2007 +0000
@@ -103,7 +103,7 @@
 	}
 	for (i = first; i <= last; i++) {
 		struct cdrom_tocentry tocentry;
-		tocentry.cdte_track = (i == last) ? 0xAA : i;
+		tocentry.cdte_track = (i == last) ? 0xAA : i + 1;
 		tocentry.cdte_format = CDROM_MSF;
 		ioctl(drive, CDROMREADTOCENTRY, &tocentry);
 		cdtoc[i].min = tocentry.cdte_addr.msf.minute;
@@ -118,7 +118,7 @@
 	}
 	for (i = first; i <= last; i++) {
 		struct ioc_read_toc_single_entry tocentry;
-		tocentry.track = (i == last) ? 0xAA : i;
+		tocentry.track = (i == last) ? 0xAA : i + 1;
 		tocentry.address_format = CD_MSF_FORMAT;
 		ioctl(drive, CDIOREADTOCENTRY, &tocentry);
 		cdtoc[i].min = tocentry.entry.addr.msf.minute;
@@ -134,7 +134,7 @@
 	for (i = first; i <= last; i++) {
 		struct ioc_read_toc_entry tocentry;
 		struct cd_toc_entry toc_buffer;
-		tocentry.starting_track = (i == last) ? 0xAA : i;
+		tocentry.starting_track = (i == last) ? 0xAA : i + 1;
 		tocentry.address_format = CD_MSF_FORMAT;
 		tocentry.data = &toc_buffer;
 		tocentry.data_len = sizeof(toc_buffer);