Commit eb99694e authored by Sebastian Dröge's avatar Sebastian Dröge 🍵
Browse files

Minor cleanup of appsink example

parent 90700aa9
...@@ -124,9 +124,7 @@ fn create_pipeline() -> Result<gst::Pipeline, Error> { ...@@ -124,9 +124,7 @@ fn create_pipeline() -> Result<gst::Pipeline, Error> {
Ok(pipeline) Ok(pipeline)
} }
fn main_loop() -> Result<(), Error> { fn main_loop(pipeline: gst::Pipeline) -> Result<(), Error> {
let pipeline = create_pipeline()?;
pipeline.set_state(gst::State::Playing).into_result()?; pipeline.set_state(gst::State::Playing).into_result()?;
let bus = pipeline let bus = pipeline
...@@ -157,7 +155,7 @@ fn main_loop() -> Result<(), Error> { ...@@ -157,7 +155,7 @@ fn main_loop() -> Result<(), Error> {
} }
fn main() { fn main() {
match main_loop() { match create_pipeline().and_then(main_loop) {
Ok(r) => r, Ok(r) => r,
Err(e) => eprintln!("Error! {}", e), Err(e) => eprintln!("Error! {}", e),
} }
......
Supports Markdown
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