mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-05 13:30:02 -05:00
jack: don't take clock time as awake timestamp
Take a sample from the monotonic clock to generate the AWAKE timestamp.
This commit is contained in:
parent
e7b5bd5e5b
commit
5e5bab4680
1 changed files with 5 additions and 3 deletions
|
|
@ -905,7 +905,8 @@ static inline jack_transport_state_t position_to_jack(struct pw_node_activation
|
||||||
|
|
||||||
static inline uint32_t cycle_run(struct client *c)
|
static inline uint32_t cycle_run(struct client *c)
|
||||||
{
|
{
|
||||||
uint64_t cmd, nsec;
|
uint64_t cmd;
|
||||||
|
struct timespec ts;
|
||||||
int fd = c->socket_source->fd;
|
int fd = c->socket_source->fd;
|
||||||
uint32_t buffer_frames, sample_rate;
|
uint32_t buffer_frames, sample_rate;
|
||||||
struct spa_io_position *pos = c->position;
|
struct spa_io_position *pos = c->position;
|
||||||
|
|
@ -926,9 +927,10 @@ static inline uint32_t cycle_run(struct client *c)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsec = pos->clock.nsec;
|
clock_gettime(CLOCK_MONOTONIC, &ts);
|
||||||
activation->status = PW_NODE_ACTIVATION_AWAKE;
|
activation->status = PW_NODE_ACTIVATION_AWAKE;
|
||||||
activation->awake_time = nsec;
|
activation->awake_time = SPA_TIMESPEC_TO_NSEC(&ts);
|
||||||
|
|
||||||
if (c->first) {
|
if (c->first) {
|
||||||
if (c->thread_init_callback)
|
if (c->thread_init_callback)
|
||||||
c->thread_init_callback(c->thread_init_arg);
|
c->thread_init_callback(c->thread_init_arg);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue