ao_coreaudio: set ao->device_buffer base on hardware latency

This commit is contained in:
Misaki Kasumi 2024-05-22 09:05:30 +08:00 committed by der richter
parent 4e6d591f12
commit a791408659
1 changed files with 2 additions and 0 deletions

View File

@ -16,6 +16,7 @@
*/
#include <CoreAudio/HostTime.h>
#include <libavutil/mathematics.h>
#include "ao.h"
#include "internal.h"
@ -178,6 +179,7 @@ static int init(struct ao *ao)
goto coreaudio_error;
reinit_latency(ao);
ao->device_buffer = av_rescale(p->hw_latency_ns, ao->samplerate, 1000000000) * 2;
p->queue = dispatch_queue_create("io.mpv.coreaudio_stop_during_idle",
DISPATCH_QUEUE_SERIAL);