Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'generic/threadshare/examples/udpsrc_benchmark_sender.rs')
-rw-r--r--generic/threadshare/examples/udpsrc_benchmark_sender.rs49
1 files changed, 25 insertions, 24 deletions
diff --git a/generic/threadshare/examples/udpsrc_benchmark_sender.rs b/generic/threadshare/examples/udpsrc_benchmark_sender.rs
index 497225d4f..bb7ce23fb 100644
--- a/generic/threadshare/examples/udpsrc_benchmark_sender.rs
+++ b/generic/threadshare/examples/udpsrc_benchmark_sender.rs
@@ -170,31 +170,32 @@ fn run(pipeline: gst::Pipeline) {
let bus = pipeline.bus().unwrap();
let l_clone = l.clone();
- bus.add_watch(move |_, msg| {
- use gst::MessageView;
- match msg.view() {
- MessageView::Eos(_) => {
- gst::info!(CAT, "Received eos");
- l_clone.quit();
-
- glib::Continue(false)
+ let _bus_watch = bus
+ .add_watch(move |_, msg| {
+ use gst::MessageView;
+ match msg.view() {
+ MessageView::Eos(_) => {
+ gst::info!(CAT, "Received eos");
+ l_clone.quit();
+
+ glib::Continue(false)
+ }
+ MessageView::Error(msg) => {
+ gst::error!(
+ CAT,
+ "Error from {:?}: {} ({:?})",
+ msg.src().map(|s| s.path_string()),
+ msg.error(),
+ msg.debug()
+ );
+ l_clone.quit();
+
+ glib::Continue(false)
+ }
+ _ => glib::Continue(true),
}
- MessageView::Error(msg) => {
- gst::error!(
- CAT,
- "Error from {:?}: {} ({:?})",
- msg.src().map(|s| s.path_string()),
- msg.error(),
- msg.debug()
- );
- l_clone.quit();
-
- glib::Continue(false)
- }
- _ => glib::Continue(true),
- }
- })
- .expect("Failed to add bus watch");
+ })
+ .expect("Failed to add bus watch");
pipeline.set_state(gst::State::Playing).unwrap();
l.run();