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:
Wim Taymans 2020-01-31 13:35:39 +01:00
parent e7b5bd5e5b
commit 5e5bab4680

View file

@ -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);