examples: Update for glib API changes

Timeouts now use std::time::Duration instead of plain integers.
This commit is contained in:
Sebastian Dröge 2020-09-14 16:44:46 +03:00
parent a540274c72
commit da4efdfa90
2 changed files with 2 additions and 2 deletions

View file

@ -84,7 +84,7 @@ fn create_ui(app: &gtk::Application) {
// the underlying pipeline, and display it in our gui.
// Since this closure is called by the mainloop thread, we are allowed
// to modify the gui widgets here.
let timeout_id = glib::timeout_add_local(500, move || {
let timeout_id = glib::timeout_add_local(std::time::Duration::from_millis(500), move || {
// Here we temporarily retrieve a strong reference on the pipeline from the weak one
// we moved into this callback.
let pipeline = match pipeline_weak.upgrade() {

View file

@ -195,7 +195,7 @@ fn create_ui(app: &gtk::Application) {
// the underlying pipeline, and display it in our gui.
// Since this closure is called by the mainloop thread, we are allowed
// to modify the gui widgets here.
let timeout_id = glib::timeout_add_local(500, move || {
let timeout_id = glib::timeout_add_local(std::time::Duration::from_millis(500), move || {
// Here we temporarily retrieve a strong reference on the pipeline from the weak one
// we moved into this callback.
let pipeline = match pipeline_weak.upgrade() {