mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-07-08 18:06:30 +00:00
feat: add 23.98fps as valid --scc-framerate value and fix help text
- Add case 4 (23.976f) to both get_scc_fps() and get_scc_fps_internal() in ccx_encoders_scc.c so --scc-framerate 23.98 produces correct output - Add "23.98" | "23.976" match arm in parser.rs mapping to value 4 - Add test_scc_framerate_23_98() unit test in parser.rs - Update --scc-framerate help text to clarify it affects both input parsing AND output encoding (not input only) - Add 23.98 to the listed valid values in the help text Follows up on discussion in #2145 and #2146.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
0.96.6 (2026-02-19)
|
||||
-------------------
|
||||
- New: Add 23.98fps as valid --scc-framerate value; clarify help text covers input and output (#2147)
|
||||
- FIX: spupng start numbering at sub0000, avoid index advance on empty EOD, normalize header filename
|
||||
- New: 32-bit (x86) Windows build and installer (#2116)
|
||||
- New: Add optional machine-readable JSON output for -out=report via --report-format json
|
||||
|
||||
@@ -21,7 +21,7 @@ unsigned char odd_parity(const unsigned char byte)
|
||||
*/
|
||||
|
||||
// Get frame rate value from scc_framerate setting
|
||||
// 0=29.97 (default), 1=24, 2=25, 3=30
|
||||
// 0=29.97 (default), 1=24, 2=25, 3=30, 4=23.98
|
||||
static float get_scc_fps_internal(int scc_framerate)
|
||||
{
|
||||
switch (scc_framerate)
|
||||
@@ -32,6 +32,8 @@ static float get_scc_fps_internal(int scc_framerate)
|
||||
return 25.0f;
|
||||
case 3:
|
||||
return 30.0f;
|
||||
case 4:
|
||||
return 23.976f;
|
||||
default:
|
||||
return 29.97f;
|
||||
}
|
||||
@@ -827,7 +829,7 @@ enum control_code get_font_code(enum font_bits font, enum ccx_decoder_608_color_
|
||||
}
|
||||
|
||||
// Get frame rate value from scc_framerate setting
|
||||
// 0=29.97 (default), 1=24, 2=25, 3=30
|
||||
// 0=29.97 (default), 1=24, 2=25, 3=30, 4=23.98
|
||||
static float get_scc_fps(int scc_framerate)
|
||||
{
|
||||
switch (scc_framerate)
|
||||
@@ -838,6 +840,8 @@ static float get_scc_fps(int scc_framerate)
|
||||
return 25.0f;
|
||||
case 3:
|
||||
return 30.0f;
|
||||
case 4:
|
||||
return 23.976f;
|
||||
default:
|
||||
return 29.97f;
|
||||
}
|
||||
|
||||
@@ -296,8 +296,8 @@ pub struct Args {
|
||||
/// DVD Recorder)
|
||||
#[arg(long="90090", verbatim_doc_comment, help_heading=OPTIONS_AFFECTING_INPUT_FILES)]
|
||||
pub mpeg90090: bool,
|
||||
/// Set the frame rate for SCC (Scenarist Closed Caption) input files.
|
||||
/// Valid values: 29.97 (default), 24, 25, 30
|
||||
/// Set the frame rate for Scenarist Closed Captioning (SCC) input parsing and output encoding.
|
||||
/// Valid values: 23.98, 29.97 (default), 24, 25, 30
|
||||
/// Example: --scc-framerate 25
|
||||
#[arg(long="scc-framerate", verbatim_doc_comment, value_name="fps", help_heading=OPTIONS_AFFECTING_INPUT_FILES)]
|
||||
pub scc_framerate: Option<String>,
|
||||
|
||||
@@ -839,6 +839,7 @@ impl OptionsExt for Options {
|
||||
if let Some(ref fps_str) = args.scc_framerate {
|
||||
self.scc_framerate = match fps_str.as_str() {
|
||||
"29.97" | "29" => 0,
|
||||
"23.98" | "23.976" => 4,
|
||||
"24" => 1,
|
||||
"25" => 2,
|
||||
"30" => 3,
|
||||
@@ -2830,6 +2831,11 @@ pub mod tests {
|
||||
assert_eq!(options.scc_framerate, 0);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_scc_framerate_23_98() {
|
||||
let (options, _) = parse_args(&["--scc-framerate", "23.98"]);
|
||||
assert_eq!(options.scc_framerate, 4);
|
||||
}
|
||||
#[test]
|
||||
fn test_scc_framerate_24() {
|
||||
let (options, _) = parse_args(&["--scc-framerate", "24"]);
|
||||
|
||||
Reference in New Issue
Block a user