Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions docs/ccextractor.cnf.sample
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
#
# To enable required option please uncomment option
#
# Only these tags are read: INPUT_SOURCE, BUFFER_INPUT, NOFONT_COLOR,
# NOTYPE_SETTING, OUTPUT_FORMAT, VIDEO_EDITED, GOP_TIME, FIX_PADDING,
# GUI_MODE_REPORTS, NO_PROGRESS_BAR, CAP_FILE, PROFANITY_FILE, START_AT,
# END_AT, INVESTIGATE_PACKET, FULL_BIN, NO_SYNC, HAUPPAUGE_MODE,
# MP4_VIDEO_TRACK, USE_PIC_ORDER, AUTO_MYTH, WTV_MPEG2, DATE_FORMAT,
# NO_ROLL_UP, FORCED_RU, DIRECT_ROLLUP and SCREEN_TO_PROCESS.
# Any other tag below is not supported yet and is reported as unknown.
#


# The Input Source tag option gives ability to user
Expand Down Expand Up @@ -173,7 +181,7 @@ INPUT_SOURCE=0
# 0 = no
# 1 = yes

#FIX_PADDINDG=0
#FIX_PADDING=0

# If you hate the repeated lines caused by the roll-up
# emulation, you can have ccextractor write only one
Expand Down Expand Up @@ -203,7 +211,7 @@ INPUT_SOURCE=0
# 2
# 3

#FORCED_RU
#FORCED_RU=

# This tag trim line
# This tag take number in its input and there meaning
Expand Down Expand Up @@ -277,12 +285,12 @@ INPUT_SOURCE=0
# start extraction from the time specified
# this tag only accepts SS, MM:SS or HH:MM:SS

#START_AT
#START_AT=

# End extraction at the time specified
# this tag only accepts SS, MM:SS or HH:MM:SS

#END_AT
#END_AT=

# If no CC packets are detected based on the PMT, try
# to find data in all packets by scanning.
Expand All @@ -291,7 +299,7 @@ INPUT_SOURCE=0
# 0 = no
# 1 = yes

#INVASTIGATE_PACKET=0
#INVESTIGATE_PACKET=0

# If the video was recorder using a Hauppauge card, it
# might need special processing. This parameter will
Expand All @@ -309,7 +317,7 @@ INPUT_SOURCE=0
# 0 = no
# 1 = yes

#MP4_VIDEO_TRACK
#MP4_VIDEO_TRACK=

# File need to be encoding in which format
# This tag take number in its input and there meaning
Expand Down
22 changes: 15 additions & 7 deletions src/rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -789,20 +789,21 @@ pub unsafe extern "C" fn ccxr_parse_parameters(argc: c_int, argv: *mut *mut c_ch
let mut opt = Options::default();
let mut _tlt_config = TeletextConfig::default();

// Settings from ccextractor.cnf are applied first so command line options override them
// Settings from ccextractor.cnf are applied first so command line options override them.
// The messages are held back until the command line is parsed, because only then is it known
// whether messages go to stdout, stderr or nowhere (--stdout, --quiet).
let mut config_messages: Vec<String> = Vec::new();
match std::fs::read_to_string(CONFIG_FILE_NAME) {
Ok(contents) => {
for warning in opt.apply_config(&contents) {
lib_ccxr::info!(
config_messages.push(format!(
"{}:{}: {}, ignoring this line\n",
CONFIG_FILE_NAME,
warning.line,
warning.message
);
CONFIG_FILE_NAME, warning.line, warning.message
));
}
}
Err(e) if e.kind() == std::io::ErrorKind::NotFound => {}
Err(e) => lib_ccxr::info!("Could not read {}: {}\n", CONFIG_FILE_NAME, e),
Err(e) => config_messages.push(format!("Could not read {}: {}\n", CONFIG_FILE_NAME, e)),
}

opt.parse_parameters(
Expand All @@ -812,6 +813,13 @@ pub unsafe extern "C" fn ccxr_parse_parameters(argc: c_int, argv: *mut *mut c_ch
&mut _profane,
);

if let Some(mut logger) = lib_ccxr::util::log::logger_mut() {
logger.set_target(opt.messages_target);
}
for message in config_messages {
lib_ccxr::info!("{}", message);
}

// Handle --list-tracks mode: list tracks and exit early
if opt.list_tracks_only {
use std::path::Path;
Expand Down
Loading