From 36c7e820d8624c79dfa4815aa87ba390eb08eca4 Mon Sep 17 00:00:00 2001 From: George Kiagiadakis Date: Thu, 1 Jul 2021 11:51:11 +0300 Subject: [PATCH] test nodes: make the timerfd non-blocking Relates to #1377 --- spa/plugins/audiotestsrc/audiotestsrc.c | 2 +- spa/plugins/test/fakesink.c | 3 ++- spa/plugins/test/fakesrc.c | 3 ++- spa/plugins/videotestsrc/videotestsrc.c | 3 ++- spa/plugins/vulkan/vulkan-compute-source.c | 3 ++- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/spa/plugins/audiotestsrc/audiotestsrc.c b/spa/plugins/audiotestsrc/audiotestsrc.c index ebaba714b..02ffc36cb 100644 --- a/spa/plugins/audiotestsrc/audiotestsrc.c +++ b/spa/plugins/audiotestsrc/audiotestsrc.c @@ -1050,7 +1050,7 @@ impl_init(const struct spa_handle_factory *factory, this->timer_source.func = on_output; this->timer_source.data = this; this->timer_source.fd = spa_system_timerfd_create(this->data_system, - CLOCK_MONOTONIC, SPA_FD_CLOEXEC); + CLOCK_MONOTONIC, SPA_FD_CLOEXEC | SPA_FD_NONBLOCK); this->timer_source.mask = SPA_IO_IN; this->timer_source.rmask = 0; this->timerspec.it_value.tv_sec = 0; diff --git a/spa/plugins/test/fakesink.c b/spa/plugins/test/fakesink.c index 7dcf8e57a..f7a8c453d 100644 --- a/spa/plugins/test/fakesink.c +++ b/spa/plugins/test/fakesink.c @@ -763,7 +763,8 @@ impl_init(const struct spa_handle_factory *factory, this->timer_source.func = on_input; this->timer_source.data = this; - this->timer_source.fd = spa_system_timerfd_create(this->data_system, CLOCK_MONOTONIC, SPA_FD_CLOEXEC); + this->timer_source.fd = spa_system_timerfd_create(this->data_system, CLOCK_MONOTONIC, + SPA_FD_CLOEXEC | SPA_FD_NONBLOCK); this->timer_source.mask = SPA_IO_IN; this->timer_source.rmask = 0; this->timerspec.it_value.tv_sec = 0; diff --git a/spa/plugins/test/fakesrc.c b/spa/plugins/test/fakesrc.c index c12941c31..1d3f0dc27 100644 --- a/spa/plugins/test/fakesrc.c +++ b/spa/plugins/test/fakesrc.c @@ -795,7 +795,8 @@ impl_init(const struct spa_handle_factory *factory, this->timer_source.func = on_output; this->timer_source.data = this; - this->timer_source.fd = spa_system_timerfd_create(this->data_system, CLOCK_MONOTONIC, SPA_FD_CLOEXEC); + this->timer_source.fd = spa_system_timerfd_create(this->data_system, CLOCK_MONOTONIC, + SPA_FD_CLOEXEC | SPA_FD_NONBLOCK); this->timer_source.mask = SPA_IO_IN; this->timer_source.rmask = 0; this->timerspec.it_value.tv_sec = 0; diff --git a/spa/plugins/videotestsrc/videotestsrc.c b/spa/plugins/videotestsrc/videotestsrc.c index 856cfd840..bdb9e9933 100644 --- a/spa/plugins/videotestsrc/videotestsrc.c +++ b/spa/plugins/videotestsrc/videotestsrc.c @@ -904,7 +904,8 @@ impl_init(const struct spa_handle_factory *factory, this->timer_source.func = on_output; this->timer_source.data = this; - this->timer_source.fd = spa_system_timerfd_create(this->data_system, CLOCK_MONOTONIC, SPA_FD_CLOEXEC); + this->timer_source.fd = spa_system_timerfd_create(this->data_system, CLOCK_MONOTONIC, + SPA_FD_CLOEXEC | SPA_FD_NONBLOCK); this->timer_source.mask = SPA_IO_IN; this->timer_source.rmask = 0; this->timerspec.it_value.tv_sec = 0; diff --git a/spa/plugins/vulkan/vulkan-compute-source.c b/spa/plugins/vulkan/vulkan-compute-source.c index 9ffa0c5a0..9e506b705 100644 --- a/spa/plugins/vulkan/vulkan-compute-source.c +++ b/spa/plugins/vulkan/vulkan-compute-source.c @@ -920,7 +920,8 @@ impl_init(const struct spa_handle_factory *factory, this->timer_source.func = on_output; this->timer_source.data = this; - this->timer_source.fd = spa_system_timerfd_create(this->data_system, CLOCK_MONOTONIC, SPA_FD_CLOEXEC); + this->timer_source.fd = spa_system_timerfd_create(this->data_system, CLOCK_MONOTONIC, + SPA_FD_CLOEXEC | SPA_FD_NONBLOCK); this->timer_source.mask = SPA_IO_IN; this->timer_source.rmask = 0; this->timerspec.it_value.tv_sec = 0;