From 80e2aaf3792fa662397005e72603d7e0c9e62dfc Mon Sep 17 00:00:00 2001 From: Jochen Keil Date: Sat, 28 Mar 2009 10:13:44 +0100 Subject: Bugfix for time/offset in flac plugin Previous cast to float didn't have any effect because one value is uint and the other is a floating type but the number itself is even.. This caused some tracks to end before they were really at an end. --- src/decoder/flac_plugin.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/decoder/flac_plugin.c b/src/decoder/flac_plugin.c index bde1cb7e2..6d874a886 100644 --- a/src/decoder/flac_plugin.c +++ b/src/decoder/flac_plugin.c @@ -501,8 +501,8 @@ flac_container_decode(struct decoder* decoder, && (tnum <= cs->data.cue_sheet.num_tracks - 1)) { t_start = cs->data.cue_sheet.tracks[tnum - 1].offset; - t_end = cs->data.cue_sheet.tracks[tnum].offset - 1; - track_time = cs->data.cue_sheet.tracks[tnum].offset - 1 + t_end = cs->data.cue_sheet.tracks[tnum].offset; + track_time = cs->data.cue_sheet.tracks[tnum].offset - cs->data.cue_sheet.tracks[tnum - 1].offset; } @@ -575,7 +575,7 @@ flac_container_decode(struct decoder* decoder, } // set track time (order is important: after stream init) - data.total_time = (float)(track_time / data.audio_format.sample_rate); + data.total_time = ((float)track_time / (float)data.audio_format.sample_rate); data.position = 0; decoder_initialized(decoder, &data.audio_format, -- cgit v1.2.3