diff options
author | Sam Atkins <atkinssj@serenityos.org> | 2023-01-11 20:00:46 +0000 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-01-12 11:25:51 +0100 |
commit | e181b1cb820a69d92b77f74aeaee62961107f8a2 (patch) | |
tree | a7c874c2201f3dfb442a4f71ab26bf96ca933b48 /Userland/Libraries/LibVideo | |
parent | 6edc0cf5ab2fce211318b5d4f83e319897b621e5 (diff) | |
download | serenity-e181b1cb820a69d92b77f74aeaee62961107f8a2.zip |
Userland: Use Core::Timer::create_foo() factory functions where possible
Diffstat (limited to 'Userland/Libraries/LibVideo')
-rw-r--r-- | Userland/Libraries/LibVideo/PlaybackManager.cpp | 11 | ||||
-rw-r--r-- | Userland/Libraries/LibVideo/PlaybackManager.h | 4 |
2 files changed, 4 insertions, 11 deletions
diff --git a/Userland/Libraries/LibVideo/PlaybackManager.cpp b/Userland/Libraries/LibVideo/PlaybackManager.cpp index 725516dee4..77d881a8fb 100644 --- a/Userland/Libraries/LibVideo/PlaybackManager.cpp +++ b/Userland/Libraries/LibVideo/PlaybackManager.cpp @@ -33,16 +33,9 @@ PlaybackManager::PlaybackManager(Core::Object& event_handler, NonnullOwnPtr<Demu , m_selected_video_track(video_track) , m_decoder(move(decoder)) , m_frame_queue(make<VideoFrameQueue>()) - , m_present_timer(Core::Timer::construct()) - , m_decode_timer(Core::Timer::construct()) { - m_present_timer->set_single_shot(true); - m_present_timer->set_interval(0); - m_present_timer->on_timeout = [&] { update_presented_frame(); }; - - m_decode_timer->set_single_shot(true); - m_decode_timer->set_interval(0); - m_decode_timer->on_timeout = [&] { on_decode_timer(); }; + m_present_timer = Core::Timer::create_single_shot(0, [&] { update_presented_frame(); }).release_value_but_fixme_should_propagate_errors(); + m_decode_timer = Core::Timer::create_single_shot(0, [&] { on_decode_timer(); }).release_value_but_fixme_should_propagate_errors(); } void PlaybackManager::set_playback_status(PlaybackStatus status) diff --git a/Userland/Libraries/LibVideo/PlaybackManager.h b/Userland/Libraries/LibVideo/PlaybackManager.h index 9fd77674b4..950c5be667 100644 --- a/Userland/Libraries/LibVideo/PlaybackManager.h +++ b/Userland/Libraries/LibVideo/PlaybackManager.h @@ -155,10 +155,10 @@ private: NonnullOwnPtr<VideoFrameQueue> m_frame_queue; Optional<FrameQueueItem> m_next_frame; - NonnullRefPtr<Core::Timer> m_present_timer; + RefPtr<Core::Timer> m_present_timer; unsigned m_decoding_buffer_time_ms = 16; - NonnullRefPtr<Core::Timer> m_decode_timer; + RefPtr<Core::Timer> m_decode_timer; u64 m_skipped_frames; }; |