Unified · Split
| @@ -16,6 +16,7 @@ · 15 unmodified lines | |||
| 16 | */ | 16 | */ |
| 17 | 17 | ||
| 18 | #include <CoreAudio/HostTime.h> | 18 | #include <CoreAudio/HostTime.h> |
| 19 | #include <libavutil/mathematics.h> | ||
| 19 | 20 | ||
| 20 | #include "ao.h" | 21 | #include "ao.h" |
| 21 | #include "internal.h" | 22 | #include "internal.h" |
| @@ -178,6 +179,7 @@ static int init(struct ao *ao) · 156 unmodified lines | |||
| 178 | goto coreaudio_error; | 179 | goto coreaudio_error; |
| 179 | 180 | ||
| 180 | reinit_latency(ao); | 181 | reinit_latency(ao); |
| 182 | ao->device_buffer = av_rescale(p->hw_latency_ns, ao->samplerate, 1000000000) * 2; | ||
| 181 | 183 | ||
| 182 | p->queue = dispatch_queue_create("io.mpv.coreaudio_stop_during_idle", | 184 | p->queue = dispatch_queue_create("io.mpv.coreaudio_stop_during_idle", |
| 183 | DISPATCH_QUEUE_SERIAL); | 185 | DISPATCH_QUEUE_SERIAL); |