summaryrefslogtreecommitdiff
path: root/src/codecs/mad.cpp
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2023-08-10 22:24:47 +1000
committerjacqueline <me@jacqueline.id.au>2023-08-10 22:24:47 +1000
commit06283e07140f39a9f3db636c8a4ff8fcbc56a290 (patch)
treefcf0ec2555ffa0db3060100d16b653d3a39e36e7 /src/codecs/mad.cpp
parentc37ccb985125f5efdf7600989331085f60d8a973 (diff)
downloadtangara-fw-06283e07140f39a9f3db636c8a4ff8fcbc56a290.tar.gz
Fix issues with timing stereo streams
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;
}