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.
This commit is contained in:
Jochen Keil 2009-03-28 10:13:44 +01:00
parent 43864762ee
commit 80e2aaf379

View File

@ -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,