decoder/flac: don't use float to calculate song duration
Simple (up-rounding) integer division is good enough. We're casting the result back to an integer anyway.
This commit is contained in:
@@ -172,9 +172,7 @@ static void of_metadata_dup_cb(G_GNUC_UNUSED const OggFLAC__SeekableStreamDecode
|
||||
|
||||
switch (block->type) {
|
||||
case FLAC__METADATA_TYPE_STREAMINFO:
|
||||
data->tag->time = ((float)block->data.stream_info.
|
||||
total_samples) /
|
||||
block->data.stream_info.sample_rate + 0.5;
|
||||
data->tag->time = flac_duration(&block->data.stream_info);
|
||||
return;
|
||||
case FLAC__METADATA_TYPE_VORBIS_COMMENT:
|
||||
flac_vorbis_comments_to_tag(data->tag, NULL,
|
||||
|
Reference in New Issue
Block a user