mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
node-driver: support node.freewheel property
To activate freewheeling when initializing
This commit is contained in:
parent
efc497a38a
commit
5c41131d6d
1 changed files with 8 additions and 0 deletions
|
|
@ -134,6 +134,8 @@ static void on_timeout(struct spa_source *source)
|
|||
this->next_time = nsec + duration * SPA_NSEC_PER_SEC / rate;
|
||||
|
||||
if (SPA_LIKELY(this->clock)) {
|
||||
SPA_FLAG_UPDATE(this->clock->flags,
|
||||
SPA_IO_CLOCK_FLAG_FREEWHEEL, this->props.freewheel);
|
||||
this->clock->nsec = nsec;
|
||||
this->clock->position += duration;
|
||||
this->clock->duration = duration;
|
||||
|
|
@ -302,6 +304,7 @@ impl_init(const struct spa_handle_factory *factory,
|
|||
uint32_t n_support)
|
||||
{
|
||||
struct impl *this;
|
||||
const char *str;
|
||||
|
||||
spa_return_val_if_fail(factory != NULL, -EINVAL);
|
||||
spa_return_val_if_fail(handle != NULL, -EINVAL);
|
||||
|
|
@ -354,6 +357,11 @@ impl_init(const struct spa_handle_factory *factory,
|
|||
|
||||
reset_props(&this->props);
|
||||
|
||||
if (info) {
|
||||
if ((str = spa_dict_lookup(info, "node.freewheel")) != NULL)
|
||||
this->props.freewheel = (strcmp(str, "true") == 0 || atoi(str) == 1);
|
||||
}
|
||||
|
||||
spa_loop_add_source(this->data_loop, &this->timer_source);
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue