bluez5: add a simple clock to sinks/sources

Fixes #269
This commit is contained in:
Wim Taymans 2020-09-02 13:36:22 +02:00
parent 4867edb947
commit 6b50279364
4 changed files with 36 additions and 1 deletions

View file

@ -678,6 +678,15 @@ static int flush_data(struct impl *this, uint64_t now_time)
spa_system_timerfd_settime(this->data_system, this->timerfd, SPA_FD_TIMER_ABSTIME, &ts, NULL);
this->source.mask = SPA_IO_IN;
spa_loop_update_source(this->data_loop, &this->source);
if (this->clock) {
this->clock->nsec = now_time;
this->clock->position = this->sample_count;
this->clock->duration = this->write_samples;
this->clock->delay = queued;
this->clock->rate_diff = 1.0f;
this->clock->next_nsec = SPA_TIMESPEC_TO_NSEC(&ts.it_value);
}
} else {
this->start_time = now_time;
this->sample_time = 0;