summaryrefslogtreecommitdiff
path: root/plugins/flac
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2011-03-28 18:56:51 +0200
committerGravatar waker <wakeroid@gmail.com>2011-03-28 18:56:51 +0200
commitaffa1bc24235bce82ad8c6cd5182c36f084a4e90 (patch)
tree7c6a2273e1da3b00e724ceed2be124cf1dbb7b03 /plugins/flac
parent1221123ae8bb00a59e189aca00c9c611f0d09ad2 (diff)
fixed flac regression which caused subtracks to get wrong length
Diffstat (limited to 'plugins/flac')
-rw-r--r--plugins/flac/flac.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/plugins/flac/flac.c b/plugins/flac/flac.c
index fb4b05d9..5904c75d 100644
--- a/plugins/flac/flac.c
+++ b/plugins/flac/flac.c
@@ -290,12 +290,11 @@ cflac_init (DB_fileinfo_t *_info, DB_playItem_t *it) {
if (res) {
fsize -= position;
}
- info->totalsamples = FLAC__stream_decoder_get_total_samples (info->decoder);
- if (info->totalsamples <= 0) {
+ int64_t totalsamples = FLAC__stream_decoder_get_total_samples (info->decoder);
+ if (totalsamples <= 0) {
return -1;
}
- float sec = info->totalsamples / (float)_info->fmt.samplerate;
- deadbeef->pl_set_item_duration (it, sec);
+ float sec = totalsamples / (float)_info->fmt.samplerate;
if (sec > 0) {
info->bitrate = fsize / sec * 8 / 1000;
}