From eb99694ed358f3a6d8bf03db90ccc7c0bd0cdd68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Sat, 11 Nov 2017 16:56:37 +0100 Subject: [PATCH] Minor cleanup of appsink example --- examples/src/bin/appsink.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/examples/src/bin/appsink.rs b/examples/src/bin/appsink.rs index 4fe6bf715..a8899bd9f 100644 --- a/examples/src/bin/appsink.rs +++ b/examples/src/bin/appsink.rs @@ -124,9 +124,7 @@ fn create_pipeline() -> Result { Ok(pipeline) } -fn main_loop() -> Result<(), Error> { - let pipeline = create_pipeline()?; - +fn main_loop(pipeline: gst::Pipeline) -> Result<(), Error> { pipeline.set_state(gst::State::Playing).into_result()?; let bus = pipeline @@ -157,7 +155,7 @@ fn main_loop() -> Result<(), Error> { } fn main() { - match main_loop() { + match create_pipeline().and_then(main_loop) { Ok(r) => r, Err(e) => eprintln!("Error! {}", e), }