Make use of Bus::add_watch_local()

This commit is contained in:
Sebastian Dröge 2019-02-10 12:06:40 +02:00
parent e6992345cc
commit f2d79fb352
2 changed files with 4 additions and 4 deletions

View file

@ -112,8 +112,8 @@ fn create_ui(app: &gtk::Application) {
.set_state(gst::State::Playing) .set_state(gst::State::Playing)
.expect("Unable to set the pipeline to the `Playing` state"); .expect("Unable to set the pipeline to the `Playing` state");
let app_weak = glib::SendWeakRef::from(app.downgrade()); let app_weak = app.downgrade();
bus.add_watch(move |_, msg| { bus.add_watch_local(move |_, msg| {
use gst::MessageView; use gst::MessageView;
let app = match app_weak.upgrade() { let app = match app_weak.upgrade() {

View file

@ -215,8 +215,8 @@ fn create_ui(app: &gtk::Application) {
.set_state(gst::State::Playing) .set_state(gst::State::Playing)
.expect("Unable to set the pipeline to the `Playing` state"); .expect("Unable to set the pipeline to the `Playing` state");
let app_weak = glib::SendWeakRef::from(app.downgrade()); let app_weak = app.downgrade();
bus.add_watch(move |_, msg| { bus.add_watch_local(move |_, msg| {
use gst::MessageView; use gst::MessageView;
let app = match app_weak.upgrade() { let app = match app_weak.upgrade() {