Commit d18cbe59 authored by Zeeshan Ali's avatar Zeeshan Ali Committed by Sebastian Dröge

examples: More robust cli arg handling

parent 246a5436
......@@ -12,7 +12,8 @@ fn main() {
let uri: &str = if args.len() == 2 {
args[1].as_ref()
} else {
panic!("Usage: decodebin file_path")
println!("Usage: decodebin file_path");
std::process::exit(-1);
};
let pipeline = gst::Pipeline::new(None);
......
......@@ -12,7 +12,8 @@ fn main() {
let uri: &str = if args.len() == 2 {
args[1].as_ref()
} else {
panic!("Usage: playbin uri")
println!("Usage: playbin uri");
std::process::exit(-1);
};
let playbin = gst::ElementFactory::make("playbin", None).unwrap();
......
......@@ -70,7 +70,8 @@ fn main() {
let uri: &str = if args.len() == 2 {
args[1].as_ref()
} else {
panic!("Usage: player uri")
println!("Usage: player uri");
std::process::exit(-1);
};
#[cfg(not(feature = "gst-player"))] {
......
......@@ -12,7 +12,8 @@ fn main() {
let uri: &str = if args.len() == 2 {
args[1].as_ref()
} else {
panic!("Usage: toc file_path")
println!("Usage: toc file_path");
std::process::exit(-1);
};
let pipeline = gst::Pipeline::new(None);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment