summaryrefslogtreecommitdiffstats
path: root/stream/stream_cdda.c
diff options
context:
space:
mode:
Diffstat (limited to 'stream/stream_cdda.c')
-rw-r--r--stream/stream_cdda.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/stream/stream_cdda.c b/stream/stream_cdda.c
index 52eeb3e3e5..a75ee3ae40 100644
--- a/stream/stream_cdda.c
+++ b/stream/stream_cdda.c
@@ -257,11 +257,11 @@ static int control(stream_t *stream, int cmd, void *arg)
int track = *(double *)arg;
int start_track = get_track_by_sector(p, p->start_sector);
int end_track = get_track_by_sector(p, p->end_sector);
- track += start_track + 1;
+ track += start_track;
if (track > end_track)
return STREAM_ERROR;
int64_t sector = p->cd->disc_toc[track].dwStartSector;
- int64_t pos = sector * (CDIO_CD_FRAMESIZE_RAW + 1) - 1;
+ int64_t pos = sector * CDIO_CD_FRAMESIZE_RAW;
// Assume standard audio CD: 44.1khz, 2 channels, s16 samples
*(double *)arg = pos / (44100.0 * 2 * 2);
return STREAM_OK;