pdeljanov / Symphonia

Pure Rust multimedia format demuxing, tag reading, and audio decoding library
Mozilla Public License 2.0
2.42k stars 144 forks source link

Probe: Actually return errors instead of logging them #285

Open MeFisto94 opened 6 months ago

MeFisto94 commented 6 months ago

So, the title is a bit hard to get, but I stumbled over the following problem: https://github.com/pdeljanov/Symphonia/blob/4f41954de75e2447753f3e522cc7345ec414a703/symphonia-core/src/probe.rs#L299

Essentially, my stream wasn't ready to be read, but this code actually "ignores" the actual error (well, it's sent to a logger, which I didn't see), and returns a more generic error, that makes you believe that the detection failed or you are missing parsers. After all, however, it was rather an IO error.

So, my suggestions would be to return a more specific error in the if clause instead.