diff options
author | Jochen Keil <jochen.keil@gmail.com> | 2009-03-28 10:13:44 +0100 |
---|---|---|
committer | Jochen Keil <jochen.keil@gmail.com> | 2009-03-28 10:13:44 +0100 |
commit | 80e2aaf3792fa662397005e72603d7e0c9e62dfc (patch) | |
tree | ca9d6fefef79fe0aed2172fdff8bf1d2baf1ed9f /src/decoder | |
parent | 43864762eec8857a7057944eb27e38140f4e346a (diff) | |
download | mpd-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.
Diffstat (limited to 'src/decoder')
-rw-r--r-- | src/decoder/flac_plugin.c | 6 |
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, |