diff options
| author | jacqueline <me@jacqueline.id.au> | 2023-07-07 19:13:43 +1000 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2023-07-07 19:13:43 +1000 |
| commit | 804aa38bff520d0954ae2b5d3587522820138dd7 (patch) | |
| tree | 44c75381f5bee57a07974b2a47256531fa3c2e90 /src | |
| parent | 8f8bc1f088b389a683735d626cbce9adb1f6dc17 (diff) | |
| download | tangara-fw-804aa38bff520d0954ae2b5d3587522820138dd7.tar.gz | |
clarify mp3 seek weirdness
Diffstat (limited to 'src')
| -rw-r--r-- | src/codecs/mad.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/codecs/mad.cpp b/src/codecs/mad.cpp index ca9a0f6e..bb64ed15 100644 --- a/src/codecs/mad.cpp +++ b/src/codecs/mad.cpp @@ -199,8 +199,11 @@ auto MadMp3Decoder::SeekStream(cpp::span<const std::byte> input, continue; } - // The target is within the next few frames. We should decode these, to give - // the decoder a chance to sync with the stream. + // The target is within the next few frames. We should decode these, as per + // the LAME FAQ (https://lame.sourceforge.io/tech-FAQ.txt): + // > The MP3 data for frame N is not stored in frame N, but can be spread + // > over several frames. In a typical case, the data for frame N will + // > have 20% of it stored in frame N-1 and 80% stored in frame N. while (mad_frame_decode(&frame_, &stream_) < 0) { if (MAD_RECOVERABLE(stream_.error)) { continue; |
