summaryrefslogtreecommitdiff
path: root/src/codecs/include
diff options
context:
space:
mode:
authorTom Kirchner <git@halffull.org>2025-01-11 22:18:11 -0800
committerTom Kirchner <git@halffull.org>2025-01-13 17:16:13 -0800
commitb65713624f57d4b8918a0f27dab5eccb401f5e5a (patch)
treee045ddfc6c165b5d4a570c9d967b5dea79ccc605 /src/codecs/include
parent3993835a35b1f7137c9d8665fb047a42e9ae6f94 (diff)
downloadtangara-fw-b65713624f57d4b8918a0f27dab5eccb401f5e5a.tar.gz
Skip gap samples in MP3 decoding
Diffstat (limited to 'src/codecs/include')
-rw-r--r--src/codecs/include/mad.hpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/codecs/include/mad.hpp b/src/codecs/include/mad.hpp
index fba3ef11..60a0b81c 100644
--- a/src/codecs/include/mad.hpp
+++ b/src/codecs/include/mad.hpp
@@ -56,7 +56,14 @@ class MadMp3Decoder : public ICodec {
std::unique_ptr<mad_frame> frame_;
std::unique_ptr<mad_synth> synth_;
- int current_sample_;
+ // Count of samples processed in the current frame (channels combined)
+ int current_frame_sample_;
+ // Count of samples processed in the current stream (channels separate, i.e. usually x2)
+ int current_stream_sample_;
+ // How many samples in the current stream (channels separate) with encoder delay/padding removed
+ int total_samples_;
+ // Encoder delay, i.e. how many samples to skip at the start of the stream
+ int skip_samples_;
bool is_eof_;
bool is_eos_;
};