From 3be8ae8181a92084b8e3e259729f867d97a1ea63 Mon Sep 17 00:00:00 2001 From: GAURAV KARMAKAR Date: Tue, 10 Feb 2026 23:08:29 +0530 Subject: [PATCH 1/5] Fix panic when using --mp4/--mkv without explicit input format --- src/rust/src/parser.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/rust/src/parser.rs b/src/rust/src/parser.rs index 47573a996..e19aa4194 100644 --- a/src/rust/src/parser.rs +++ b/src/rust/src/parser.rs @@ -285,10 +285,14 @@ impl OptionsExt for Options { self.set_input_format_type(InFormat::Asf); } else if args.wtv { self.set_input_format_type(InFormat::Wtv); + } else if args.mp4 { + self.set_input_format_type(InFormat::Mp4); + } else if args.mkv { + self.set_input_format_type(InFormat::Mkv); } else { fatal!( cause = ExitCause::MalformedParameter; - "Unknown input file format: {}\n", args.input.unwrap() + "Unknown input file format: {}\n", args.input.map(|i| i.to_string()).unwrap_or_else(|| "Unknown".to_string()) ); } } From 0678d9316a349efa85056370c73eb289d61dd2e9 Mon Sep 17 00:00:00 2001 From: GAURAV KARMAKAR Date: Wed, 11 Feb 2026 13:20:32 +0530 Subject: [PATCH 2/5] Restored Autodetection Logic &Fixed TCP Input Regressio --- src/rust/src/parser.rs | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/src/rust/src/parser.rs b/src/rust/src/parser.rs index e19aa4194..a46757b2d 100644 --- a/src/rust/src/parser.rs +++ b/src/rust/src/parser.rs @@ -290,13 +290,16 @@ impl OptionsExt for Options { } else if args.mkv { self.set_input_format_type(InFormat::Mkv); } else { - fatal!( - cause = ExitCause::MalformedParameter; - "Unknown input file format: {}\n", args.input.map(|i| i.to_string()).unwrap_or_else(|| "Unknown".to_string()) - ); + // fatal!( + // cause = ExitCause::MalformedParameter; + // "Unknown input file format: {}\n", args.input.map(|i| i.to_string()).unwrap_or_else(|| "Unknown".to_string()) + // ); + + // No specific format flag matched, so we fall back to autodetection. + } } - + fn parse_708_services(&mut self, s: &str) { if s.starts_with("all") { let charset = if s.len() > 3 { &s[4..s.len() - 1] } else { "" }; @@ -662,18 +665,18 @@ impl OptionsExt for Options { self.timestamp_map = true; } - if args.es - || args.ts - || args.ps - || args.asf - || args.wtv - || args.mp4 - || args.mkv - || args.dvr_ms - || args.input.is_some() - { - self.set_input_format(args); - } + // if args.es + // || args.ts + // || args.ps + // || args.asf + // || args.wtv + // || args.mp4 + // || args.mkv + // || args.dvr_ms + // || args.input.is_some() + // { + self.set_input_format(args); + // } if let Some(ref codec) = args.codec { match codec { From 5606834197285525329b613e1f08b68d564dfe0d Mon Sep 17 00:00:00 2001 From: GAURAV KARMAKAR Date: Wed, 11 Feb 2026 13:24:39 +0530 Subject: [PATCH 3/5] style: apply cargo fmt --- src/rust/src/parser.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/rust/src/parser.rs b/src/rust/src/parser.rs index a46757b2d..9060c2464 100644 --- a/src/rust/src/parser.rs +++ b/src/rust/src/parser.rs @@ -294,12 +294,11 @@ impl OptionsExt for Options { // cause = ExitCause::MalformedParameter; // "Unknown input file format: {}\n", args.input.map(|i| i.to_string()).unwrap_or_else(|| "Unknown".to_string()) // ); - - // No specific format flag matched, so we fall back to autodetection. + // No specific format flag matched, so we fall back to autodetection. } } - + fn parse_708_services(&mut self, s: &str) { if s.starts_with("all") { let charset = if s.len() > 3 { &s[4..s.len() - 1] } else { "" }; From f1368b56ca743065fc5a3bd860437917e79c2a1c Mon Sep 17 00:00:00 2001 From: GAURAV KARMAKAR Date: Mon, 16 Feb 2026 23:32:04 +0530 Subject: [PATCH 4/5] ix(parser): add --mp4/--mkv handling and remove unwrap panic Properly handle mp4/mkv flags in set_input_format() and replace args.input.unwrap() with unwrap_or(). --- src/rust/src/parser.rs | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/src/rust/src/parser.rs b/src/rust/src/parser.rs index 9060c2464..c1a96a51a 100644 --- a/src/rust/src/parser.rs +++ b/src/rust/src/parser.rs @@ -290,12 +290,13 @@ impl OptionsExt for Options { } else if args.mkv { self.set_input_format_type(InFormat::Mkv); } else { - // fatal!( - // cause = ExitCause::MalformedParameter; - // "Unknown input file format: {}\n", args.input.map(|i| i.to_string()).unwrap_or_else(|| "Unknown".to_string()) - // ); - - // No specific format flag matched, so we fall back to autodetection. + fatal!( + cause = ExitCause::MalformedParameter; + "Unknown input file format: {}\n", + args.input + .map(|i| i.to_string()) + .unwrap_or_else(|| "unknown".to_string()) + ); } } @@ -664,18 +665,18 @@ impl OptionsExt for Options { self.timestamp_map = true; } - // if args.es - // || args.ts - // || args.ps - // || args.asf - // || args.wtv - // || args.mp4 - // || args.mkv - // || args.dvr_ms - // || args.input.is_some() - // { - self.set_input_format(args); - // } + if args.es + || args.ts + || args.ps + || args.asf + || args.wtv + || args.mp4 + || args.mkv + || args.dvr_ms + || args.input.is_some() + { + self.set_input_format(args); + } if let Some(ref codec) = args.codec { match codec { From bbf9d8ab3e317d580ad420c298476f78ed90f0c0 Mon Sep 17 00:00:00 2001 From: GAURAV KARMAKAR Date: Tue, 17 Feb 2026 00:06:57 +0530 Subject: [PATCH 5/5] resolve the formatting issue --- src/rust/src/parser.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rust/src/parser.rs b/src/rust/src/parser.rs index c1a96a51a..ae5022251 100644 --- a/src/rust/src/parser.rs +++ b/src/rust/src/parser.rs @@ -291,7 +291,7 @@ impl OptionsExt for Options { self.set_input_format_type(InFormat::Mkv); } else { fatal!( - cause = ExitCause::MalformedParameter; + cause = ExitCause::MalformedParameter; "Unknown input file format: {}\n", args.input .map(|i| i.to_string())