aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJochen Keil <jochen.keil@gmail.com>2009-03-28 10:13:44 +0100
committerJochen Keil <jochen.keil@gmail.com>2009-03-28 10:13:44 +0100
commit80e2aaf3792fa662397005e72603d7e0c9e62dfc (patch)
treeca9d6fefef79fe0aed2172fdff8bf1d2baf1ed9f
parent43864762eec8857a7057944eb27e38140f4e346a (diff)
downloadmpd-80e2aaf3792fa662397005e72603d7e0c9e62dfc.tar.gz
mpd-80e2aaf3792fa662397005e72603d7e0c9e62dfc.tar.xz
mpd-80e2aaf3792fa662397005e72603d7e0c9e62dfc.zip
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.
-rw-r--r--src/decoder/flac_plugin.c6
1 files 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,