From bbc18d6349aaaabd9ae43a08c3874718a929e12b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 20 Oct 2020 12:49:51 +0300 Subject: [PATCH] Update for ClockId creation API changes --- tutorial/src/sinesrc.rs | 2 +- tutorial/tutorial-2.md | 4 ++-- utils/fallbackswitch/src/fallbacksrc.rs | 8 ++------ utils/fallbackswitch/tests/fallbackswitch.rs | 2 +- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/tutorial/src/sinesrc.rs b/tutorial/src/sinesrc.rs index 7dbd9bb2..ff2e5aff 100644 --- a/tutorial/src/sinesrc.rs +++ b/tutorial/src/sinesrc.rs @@ -802,7 +802,7 @@ impl PushSrcImpl for SineSrc { return Err(gst::FlowError::Flushing); } - let id = clock.new_single_shot_id(wait_until).unwrap(); + let id = clock.new_single_shot_id(wait_until); clock_wait.clock_id = Some(id.clone()); drop(clock_wait); diff --git a/tutorial/tutorial-2.md b/tutorial/tutorial-2.md index 7087fde9..aa6b512d 100644 --- a/tutorial/tutorial-2.md +++ b/tutorial/tutorial-2.md @@ -705,7 +705,7 @@ For working in live mode, we have to add a few different parts in various places return Ok(buffer); } - let id = clock.new_single_shot_id(wait_until).unwrap(); + let id = clock.new_single_shot_id(wait_until); gst_log!( CAT, @@ -863,7 +863,7 @@ Now as a last step, we need to actually make use of the new struct we added arou return Err(gst::FlowReturn::Flushing); } - let id = clock.new_single_shot_id(wait_until).unwrap(); + let id = clock.new_single_shot_id(wait_until); clock_wait.clock_id = Some(id.clone()); drop(clock_wait); diff --git a/utils/fallbackswitch/src/fallbacksrc.rs b/utils/fallbackswitch/src/fallbacksrc.rs index 47d2880a..a735430f 100644 --- a/utils/fallbackswitch/src/fallbacksrc.rs +++ b/utils/fallbackswitch/src/fallbacksrc.rs @@ -2022,9 +2022,7 @@ impl FallbackSrc { assert!(wait_time.is_some()); assert!(state.source_pending_restart_timeout.is_none()); - let timeout = clock - .new_single_shot_id(wait_time) - .expect("can't create clock id"); + let timeout = clock.new_single_shot_id(wait_time); let element_weak = element.downgrade(); timeout .wait_async(move |_clock, _time, _id| { @@ -2140,9 +2138,7 @@ impl FallbackSrc { wait_time, ); - let timeout = clock - .new_single_shot_id(wait_time) - .expect("can't create clock id"); + let timeout = clock.new_single_shot_id(wait_time); let element_weak = element.downgrade(); timeout .wait_async(move |_clock, _time, _id| { diff --git a/utils/fallbackswitch/tests/fallbackswitch.rs b/utils/fallbackswitch/tests/fallbackswitch.rs index 7f6c9629..739d5e4e 100644 --- a/utils/fallbackswitch/tests/fallbackswitch.rs +++ b/utils/fallbackswitch/tests/fallbackswitch.rs @@ -548,7 +548,7 @@ fn stop_pipeline(mut pipeline: Pipeline) { .unwrap(); // Signal shutdown to the clock thread - let clock_id = clock.new_single_shot_id(0.into()).unwrap(); + let clock_id = clock.new_single_shot_id(0.into()); let _ = clock_id.wait(); let switch = pipeline.get_by_name("switch").unwrap();