Repository navigation
Conversation
With -svc and no -1/-2/-12, no main output file is opened. init_output_ctx() zeroed the output struct, so its fh stayed 0, which is stdin. The file header and footer, and the data of the raw, bin, dvdraw and mcc formats, were then written to stdin: printed on the terminal (even with -quiet), or failing when stdin is not writable. For webvtt and mcc that failure ended the run with "Error: writing to file" (exit 1). Start unopened outputs at fh -1, skip the header and footer for them (except the -sendto RCWT header, which goes over the network), and have the MCC encoder skip writing when there is no file.
|
@cfsmp3 Small fix: with |
CCExtractor CI platform finished running the test files on linux. 171/238 tests matched the approved output:
67 tests do not match the approved output. That is the pass/fail verdict. Whether this branch caused it is a separate question, answered below.
Compared with the tip of master — test 10180, commit 2c1c1c6:
Compared with the commit this branch was cut from: the same run as the tip of master (test 10180), so the comparison above already covers it. No test changes behaviour relative to the tip of master: every failure above fails there too, byte for byte. The approved output for those tests is out of date, which is a baseline to review rather than a regression in this branch. |
In raising this pull request, I confirm the following (please check boxes):
Reason for this PR:
Sanity check:
Repro instructions:
Sample: c83f765c…06cd.ts (has CEA-708 service 1).
On master, even with
-quiet, this prints the SAMI header and footer on the terminal:And when stdin isn't writable (scripts, cron, CI):
The problem
-svc 1alone means "CEA-708 only", so CCExtractor doesn't open the main (608) output file. But the main output's file handle was left at 0, not -1. 0 is stdin.So everything meant for the main file went to stdin:
--bom),On a terminal it shows up as junk on the screen. In a script, the write fails. For webvtt and mcc that failure stops the run with
Error: writing to file(exit 1).Fix
src/lib_ccx/ccx_encoders_common.c:fh = -1(no file), not 0,-sendtostill gets its RCWT header, which is sent over the network.src/lib_ccx/ccx_encoders_mcc.c:Tests
The sample was run with stdin opened read-write, so anything written to it is caught. Master vs. this PR:
-svc 1, all 18--outformats: bytes written to stdin-svc 1 --out=webvttormcc, stdin not writableError: writing to file-svc 1: the.p1.svc01.*files-svc), all 17 formats-12,--stdout,-1 -svc 1,--kocOne extra change:
-svc 1 --out=spupngcrashed on master (exit 139, or exit 5 withCannot open (null)). It now runs to the end.Not changed here:
-svc 1with a format the CEA-708 writer can't write (webvtt, spupng, …) still leaves an empty.p1.svc01.*file. #2513 fixes that.No open PR touches these two files. The
-sendtopath keeps its old behaviour by design, but I couldn't test it locally.