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:47:27 +03:00
parent dc8b722f72
commit 3b5d9b7392
2 changed files with 2 additions and 2 deletions

View file

@ -126,7 +126,7 @@ fn create_ui(app: &gtk::Application) {
app.add_window(&window); app.add_window(&window);
let video_sink_weak = video_sink.downgrade(); let video_sink_weak = video_sink.downgrade();
let timeout_id = glib::timeout_add_local(100, move || { let timeout_id = glib::timeout_add_local(std::time::Duration::from_millis(100), move || {
let video_sink = match video_sink_weak.upgrade() { let video_sink = match video_sink_weak.upgrade() {
Some(video_sink) => video_sink, Some(video_sink) => video_sink,
None => return glib::Continue(true), None => return glib::Continue(true),

View file

@ -232,7 +232,7 @@ fn create_ui(app: &gtk::Application) {
let video_sink_weak = video_sink.downgrade(); let video_sink_weak = video_sink.downgrade();
let togglerecord_weak = togglerecord.downgrade(); let togglerecord_weak = togglerecord.downgrade();
let timeout_id = glib::timeout_add_local(100, move || { let timeout_id = glib::timeout_add_local(std::time::Duration::from_millis(100), move || {
let video_sink = match video_sink_weak.upgrade() { let video_sink = match video_sink_weak.upgrade() {
Some(video_sink) => video_sink, Some(video_sink) => video_sink,
None => return glib::Continue(true), None => return glib::Continue(true),