Fix HTTP source playback on Windows#273
Merged
tedwaine merged 1 commit intoJun 18, 2026
Merged
Conversation
Fixes HTTP source playback on Windows. scan_posix_path already has an
http handler in its trailing else branch, but on Windows it was
unreachable: fs::is_directory(p) for a string like
"http://host/path.mov" raises std::filesystem_error ("The specified
path is invalid"), the outer catch swallows it, and the function
returns an empty vector — the caller sees no media.
Linux behaves differently. POSIX stat() doesn't reject URL strings as
syntactically invalid; it just returns ENOENT. The throwing
fs::is_directory translates that into "return false, don't throw", so
execution falls through to the http handler. That's why the bug never
showed up there.
Switch both fs::is_directory(p) and fs::is_regular_file(p) to the
noexcept (path, error_code) overloads. They do the same syscall but
report errors through error_code instead of throwing — so on Windows
they return false for a URL string and execution reaches the http
handler, matching Linux. The error_code is intentionally unread: we
only care that the path isn't a local file or directory.
Safe on Linux because the new overloads share their implementation
with the throwing form — they're just a different way of surfacing
the same result. Real filesystem paths continue to be classified
identically.
Signed-off-by: Ben de Luca <bdeluca@gmail.com>
7b2ecee
into
AcademySoftwareFoundation:develop
2 of 3 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
scan_posix_pathalready has an http handler in its trailing else branch, but on Windows it was unreachable:fs::is_directory("http://…")throwsstd::filesystem_error("The specified path is invalid"), the outer catch swallows it, and the function returns{}— the caller sees no media. Linux's POSIXstat()returnsENOENTinstead, so the throwing overload returns false and execution falls through to the http handler. That's why the bug never showed up there.Switch both
fs::is_directoryandfs::is_regular_fileto the(path, error_code)overloads. They do the same syscall but report errors througherror_codeinstead of throwing, so on Windows they return false for a URL string and the http handler is reached, matching Linux. Safe on Linux because the new overloads share their implementation with the throwing form.