Repository navigation
[FIX] Fail cleanly when a CEA-708 file can't be created - #2396
Merged
Merged
Conversation
screen_print() unwrapped the result of writer_output(), so a per-service CEA-708 output file that couldn't be created aborted the run with a panic (SIGABRT). -o /dev/null hits this, since the service file becomes /dev/null.p1.svc01.srt; so does anything that makes the file unwritable. The C writer, and v0.94 before the port, treat this as a fatal file-creation error (exit 5). Do the same, and include the file name in the error, which previously carried only the OS message.
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.
In raising this pull request, I confirm the following (please check boxes):
Reason for this PR:
Sanity check:
Repro instructions:
Run any input with CEA-708 captions (e.g. sample
c83f765c661595e1bfa4750756a54c006c6f2c697a436bc0726986f71f0706cd.ts) with-o /dev/null. The 708 service file becomes/dev/null.p1.svc01.srt, which can't be created, and the run aborts with SIGABRT (exit 134):panicked at src/decoder/service_decoder.rs:897. Same for any unwritable per-service path (e.g. a directory namedout.p1.svc01.srtnext to-o out.srt).screen_print()unwrapped the result ofwriter_output(), so a CEA-708 output file that couldn't be created panicked. The C writer (ccx_decoders_708_output.c) and v0.94 before the port treat a failed open as a fatal file-creation error, exit 5, like the main output path does. This does the same, and includes the file name in the error, which previously carried only the OS message.-o /dev/null[CEA-708] Failed to open output file: /dev/null.p1.svc01.srt: Permission denied (os error 13)[CEA-708] Failed to open output file: blk.p1.svc01.srt: Is a directory (os error 21)Verified:
cargo test,cargo fmt --checkandcargo clippy -D warningsclean in both crates.