Repository navigation
[FIX] Print ccextractor.cnf warnings after the command line is parsed - #2385
Merged
Merged
Conversation
Warnings about bad lines in ccextractor.cnf were logged before the command line was parsed, while the logger still targeted stdout. With --stdout they ended up in front of the captions, and --quiet did not silence them. Hold the messages back, point the logger at the parsed messages target, then print them. Also fix the FIX_PADDING and INVESTIGATE_PACKET tag typos in docs/ccextractor.cnf.sample, add the missing '=' to tags that take a value, and list the tags that are actually read.
Contributor
Author
|
@cfsmp3 ready for a review whenever you get time! |
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.
Follow-up to #2369.
Problem
Warnings about bad lines in
ccextractor.cnfwere logged insideccxr_parse_parametersbefore the command line was parsed, while the logger still targeted stdout. So:-stdout, the warnings were written into the caption output ahead of the captions, which corrupts the SRT for anything reading the pipe;-quiet, they were still printed.Reproduced with a
ccextractor.cnfcontainingNO_SYNC=yesandBOGUS=1, and a small SCC file:-stdout-quiet -stdoutFix
messages_target, then print them.-stdoutsends them to stderr and-quietsilences them, like every other message.docs/ccextractor.cnf.sample: fix theFIX_PADDINDGandINVASTIGATE_PACKETtypos, add the missing=toFORCED_RU,START_AT,END_ATandMP4_VIDEO_TRACK, and list the tags that are actually read. The other tags in the sample were never supported by the C parser either, and they are now reported as unknown.Testing
Built with
mac/build.commandand ran the cases above.cargo test -p lib_ccxr config_filepasses (6 tests). There is no unit test for the ordering, since it lives in theextern "C"entry point.