summaryrefslogtreecommitdiffstats
path: root/audio/out/ao_coreaudio_utils.c
diff options
context:
space:
mode:
authorKacper Michajłow <kasper93@gmail.com>2023-10-22 07:33:19 +0200
committerDudemanguy <random342@airmail.cc>2023-10-26 20:06:14 +0000
commit729f2fed2ce1d00df7b14983bfe0c761d1dff51e (patch)
tree5e44e18f2b8e7f08c13325fa51c35f9999fb9ff5 /audio/out/ao_coreaudio_utils.c
parentf659a60dfa07664ba9a754619dbac13f5f0c7000 (diff)
downloadmpv-729f2fed2ce1d00df7b14983bfe0c761d1dff51e.tar.bz2
mpv-729f2fed2ce1d00df7b14983bfe0c761d1dff51e.tar.xz
semaphore_osx: change mp_sem_timedwait to mp_time
Diffstat (limited to 'audio/out/ao_coreaudio_utils.c')
-rw-r--r--audio/out/ao_coreaudio_utils.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/audio/out/ao_coreaudio_utils.c b/audio/out/ao_coreaudio_utils.c
index f2ab6f6315..14db8e39cd 100644
--- a/audio/out/ao_coreaudio_utils.c
+++ b/audio/out/ao_coreaudio_utils.c
@@ -500,7 +500,7 @@ bool ca_change_physical_format_sync(struct ao *ao, AudioStreamID stream,
/* The AudioStreamSetProperty is not only asynchronous,
* it is also not Atomic, in its behaviour. */
- struct timespec timeout = mp_rel_time_to_timespec(2.0);
+ int64_t wait_until = mp_time_ns() + MP_TIME_S_TO_NS(2);
AudioStreamBasicDescription actual_format = {0};
while (1) {
err = CA_GET(stream, kAudioStreamPropertyPhysicalFormat, &actual_format);
@@ -511,7 +511,7 @@ bool ca_change_physical_format_sync(struct ao *ao, AudioStreamID stream,
if (format_set)
break;
- if (mp_sem_timedwait(&wakeup, &timeout)) {
+ if (mp_sem_timedwait(&wakeup, wait_until)) {
MP_VERBOSE(ao, "reached timeout\n");
break;
}