summaryrefslogtreecommitdiffstats
path: root/audio/out/buffer.c
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2023-10-24 10:29:20 +0200
committersfan5 <sfan5@live.de>2023-10-24 10:38:07 +0200
commit3af25edfa5b88c2309843418a0e83c7ab5e0217e (patch)
treeb7d224141f6c91977dbe7a83b30de85912754f54 /audio/out/buffer.c
parent4de76ce87a545cd86ef493129b4cfeafe10e8e98 (diff)
downloadmpv-3af25edfa5b88c2309843418a0e83c7ab5e0217e.tar.bz2
mpv-3af25edfa5b88c2309843418a0e83c7ab5e0217e.tar.xz
Revert "audio: don't block on lock in ao_read_data"
It was found that this causes issues with at least ao_coreaudio, essentially revealing a way bigger issue: Some AOs don't check for 0 and/or have no way to deal with short writes. Someone will have to figure out a fix later but get rid of the direct cause for now. This reverts commit ae908a70cecebb2cac8354a3b4d8967af847bd3e.
Diffstat (limited to 'audio/out/buffer.c')
-rw-r--r--audio/out/buffer.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/audio/out/buffer.c b/audio/out/buffer.c
index e23e4cf108..c0457ba279 100644
--- a/audio/out/buffer.c
+++ b/audio/out/buffer.c
@@ -184,8 +184,7 @@ int ao_read_data(struct ao *ao, void **data, int samples, int64_t out_time_ns)
struct buffer_state *p = ao->buffer_state;
assert(!ao->driver->write);
- if (pthread_mutex_trylock(&p->lock))
- return 0;
+ pthread_mutex_lock(&p->lock);
int pos = read_buffer(ao, data, samples, &(bool){0});