Skip to content

symphonia: the README says a stream with no audio frame does not open - #93

Merged
closer-claudio merged 1 commit into
mainfrom
claudio/20261121-symphonia-empty
Nov 22, 2026
Merged

closer-claudio merged 1 commit into
mainfrom
claudio/20261121-symphonia-empty

Conversation

@closer-claudio

Copy link
Copy Markdown
Contributor

🎯 Why

symphonia exits 1 on a FLAC stream that has no audio frame, where flac -d writes an empty output and exits 0, and nothing said so. A consumer comparing the two on such a stream could not tell which side the difference came from.

🛠️ What

One sentence in symphonia/README.md: Symphonia looks for the first audio frame as it opens a stream, and reports unexpected end of file when there is none. The program is not changed: it reports what the library reports.

RFC 9639 asks for one or more frames after the metadata (https://www.rfc-editor.org/rfc/rfc9639.html#section-9), so such a stream is outside the letter of the format; the difference is with the reference tools, which write and read it.

🧪 How

On darwin-arm64, with this repository's flac 1.5.0 and symphonia:

  • : > empty.raw; flac -s --force-raw-format --endian=little --sign=signed --channels=2 --bps=16 --sample-rate=44100 -o e.flac empty.raw
  • flac -s -d -o e.wav e.flac: exit 0.
  • symphonia e.flac o.raw: unexpected end of file, exit 1.

The cause, read in symphonia-bundle-flac 0.6.1: src/demuxer.rs, init_with_metadata, parser.resync(&mut reader)? after the metadata blocks.

📝 Notes

No code, build or test changes.

Symphonia 0.6.1 synchronises to the first audio frame while it opens a
FLAC stream (symphonia-bundle-flac's demuxer.rs, init_with_metadata:
`parser.resync(&mut reader)?`), so a stream of no frames, which `flac`
writes for an empty input, fails to open with "unexpected end of file",
where `flac -d` writes an empty output and exits 0. That is the
library's, and the program reports it as it comes. Run on darwin-arm64
on flac's encoding of an empty input.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: closer-claudio <claudio@farcloser.world>
@closer-claudio closer-claudio added the internal Changes nothing for a consumer: tooling, CI, maintainers' docs; left out of the notes label Nov 22, 2026
@closer-claudio

Copy link
Copy Markdown
Contributor Author

Reviewed at c1760e4

@closer-claudio
closer-claudio merged commit c66fda5 into main Nov 22, 2026
27 checks passed
@closer-claudio
closer-claudio deleted the claudio/20261121-symphonia-empty branch November 22, 2026 02:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal Changes nothing for a consumer: tooling, CI, maintainers' docs; left out of the notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants