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_sdl.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_sdl.c')
-rw-r--r-- | audio/out/ao_sdl.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/audio/out/ao_sdl.c b/audio/out/ao_sdl.c index 032939925d..5a6a58b124 100644 --- a/audio/out/ao_sdl.c +++ b/audio/out/ao_sdl.c @@ -61,7 +61,7 @@ static void audio_callback(void *userdata, Uint8 *stream, int len) // fixed latency. double delay = 2 * len / (double)ao->bps; - ao_read_data(ao, data, len / ao->sstride, mp_time_us() + 1000000LL * delay); + ao_read_data(ao, data, len / ao->sstride, mp_time_ns() + MP_TIME_S_TO_NS(delay)); } static void uninit(struct ao *ao) |