navidrome/core/ffmpeg
Deluan ec49ae476f fix(transcoding): size the inserted mp3 frame to fit its tag
The inserted Info frame reused the first audio frame's header, and so its size.
A VBR encode at 22050Hz that starts on silence opens with an 8kbps frame of 26
bytes, while the tag needs 33, so building the frame panicked with an index out
of range. Reproduced with ffmpeg -ar 22050 -q:a 9 on a quiet input.

The frame now keeps the first frame's version, sample rate and channel mode but
raises the bitrate until the frame is big enough for the tag, which is what
ffmpeg's own mp3 muxer does. The frame count is unaffected, and decoded audio of
the reproducing file is byte-identical after the patch.
2026-09-24 17:16:42 -04:00
..
ffmpeg.go refactor(transcoding): repair piped headers behind one patcher 2026-09-24 17:16:04 -04:00
ffmpeg_test.go fix(transcoding): tag the inserted mp3 frame as Info, not Xing 2026-09-24 17:16:41 -04:00
flac_streaminfo.go refactor(transcoding): repair piped headers behind one patcher 2026-09-24 17:16:04 -04:00
flac_streaminfo_test.go refactor(transcoding): repair piped headers behind one patcher 2026-09-24 17:16:04 -04:00
mp3_xing.go fix(transcoding): size the inserted mp3 frame to fit its tag 2026-09-24 17:16:42 -04:00
mp3_xing_test.go fix(transcoding): size the inserted mp3 frame to fit its tag 2026-09-24 17:16:42 -04:00
piped_header.go refactor(transcoding): repair piped headers behind one patcher 2026-09-24 17:16:04 -04:00