mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-03-01 01:40:29 -05:00
stream: add pw_stream_get_nsec() to get current time
Make a method to get the current time to compare agains the pw_time-now field. This is currently CLOCK_MONOTONIC but make this into a method so that we can more easily change it later.
This commit is contained in:
parent
b3c7dda96a
commit
4c75d4f660
15 changed files with 52 additions and 55 deletions
|
|
@ -679,13 +679,6 @@ static int create_filters(struct impl *impl)
|
|||
return res;
|
||||
}
|
||||
|
||||
static inline uint64_t get_time_ns(void)
|
||||
{
|
||||
struct timespec ts;
|
||||
clock_gettime(CLOCK_MONOTONIC, &ts);
|
||||
return SPA_TIMESPEC_TO_NSEC(&ts);
|
||||
}
|
||||
|
||||
static void *ffado_process_thread(void *arg)
|
||||
{
|
||||
struct impl *impl = arg;
|
||||
|
|
@ -696,7 +689,7 @@ static void *ffado_process_thread(void *arg)
|
|||
ffado_wait_response response;
|
||||
|
||||
response = ffado_streaming_wait(impl->dev);
|
||||
nsec = get_time_ns();
|
||||
nsec = pw_filter_get_nsec(impl->source.filter);
|
||||
|
||||
switch (response) {
|
||||
case ffado_wait_ok:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue