mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-16 08:56:45 -05:00
node: update the duration/rate from the target
Before scheduling the graph from the driver, update the duration and rate with the new targets.
This commit is contained in:
parent
1bdd5eee69
commit
6e8625cf96
13 changed files with 87 additions and 3 deletions
|
|
@ -702,6 +702,10 @@ static void on_driver_timeout(struct spa_source *source)
|
|||
return;
|
||||
}
|
||||
}
|
||||
if (SPA_LIKELY(this->node_position_io != NULL)) {
|
||||
this->node_position_io->clock.duration = this->node_position_io->clock.target_duration;
|
||||
this->node_position_io->clock.rate = this->node_position_io->clock.target_rate;
|
||||
}
|
||||
|
||||
check_position_and_clock_config(this);
|
||||
|
||||
|
|
|
|||
|
|
@ -682,9 +682,18 @@ static int process_write(struct seq_state *state)
|
|||
return res;
|
||||
}
|
||||
|
||||
static void update_target(struct seq_state *state)
|
||||
{
|
||||
if (SPA_LIKELY(state->position)) {
|
||||
struct spa_io_clock *clock = &state->position->clock;
|
||||
clock->duration = clock->target_duration;
|
||||
clock->rate = clock->target_rate;
|
||||
}
|
||||
}
|
||||
|
||||
static void update_position(struct seq_state *state)
|
||||
{
|
||||
if (state->position) {
|
||||
if (SPA_LIKELY(state->position)) {
|
||||
struct spa_io_clock *clock = &state->position->clock;
|
||||
state->rate = clock->rate;
|
||||
if (state->rate.num == 0 || state->rate.denom == 0)
|
||||
|
|
@ -789,6 +798,8 @@ static void alsa_on_timeout_event(struct spa_source *source)
|
|||
}
|
||||
}
|
||||
|
||||
update_target(state);
|
||||
|
||||
state->current_time = state->next_time;
|
||||
|
||||
spa_log_trace(state->log, "timeout %"PRIu64, state->current_time);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue