diff options
author | Dudemanguy <random342@airmail.cc> | 2023-10-11 13:45:40 -0500 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2023-10-16 15:38:59 +0000 |
commit | 50025428b17e82c9689dab82fcd0486648c4a9fd (patch) | |
tree | f9039f4110dd54be060b5e7ef4ef3131be0a3e32 /audio/out/ao_jack.c | |
parent | d310430332b9c7dbedf28398b7018364401d327d (diff) | |
download | mpv-50025428b17e82c9689dab82fcd0486648c4a9fd.tar.bz2 mpv-50025428b17e82c9689dab82fcd0486648c4a9fd.tar.xz |
ao: convert all timing code to nanoseconds
Pull AOs work off of a callback that relies on mpv's internal timer. So
like with the related video changes, convert all of these to nanoseconds
instead. In many cases, the underlying audio API does actually provide
nanosecond resolution as well.
Diffstat (limited to 'audio/out/ao_jack.c')
-rw-r--r-- | audio/out/ao_jack.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/audio/out/ao_jack.c b/audio/out/ao_jack.c index f55974b1e8..0c9ab8e0a5 100644 --- a/audio/out/ao_jack.c +++ b/audio/out/ao_jack.c @@ -122,8 +122,8 @@ static int process(jack_nframes_t nframes, void *arg) jack_nframes_t jack_latency = atomic_load(&p->graph_latency_max) + atomic_load(&p->buffer_size); - int64_t end_time = mp_time_us(); - end_time += (jack_latency + nframes) / (double)ao->samplerate * 1000000.0; + int64_t end_time = mp_time_ns(); + end_time += MP_TIME_S_TO_NS((jack_latency + nframes) / (double)ao->samplerate); ao_read_data(ao, buffers, nframes, end_time); |