summaryrefslogtreecommitdiff
path: root/src/codecs/mad.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/codecs/mad.cpp')
-rw-r--r--src/codecs/mad.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/codecs/mad.cpp b/src/codecs/mad.cpp
index dfa568d4..f4cfb3b9 100644
--- a/src/codecs/mad.cpp
+++ b/src/codecs/mad.cpp
@@ -92,7 +92,9 @@ auto MadMp3Decoder::OpenStream(std::shared_ptr<IStream> input)
auto vbr_length = GetVbrLength(header);
if (vbr_length) {
- output.total_samples = vbr_length;
+ output.total_samples = vbr_length.value() * channels;
+ } else {
+ // FIXME: calculate length using the filesize, assuming CBR.
}
return output;
}