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 ae908a70ce.
This commit is contained in:
sfan5 2023-10-24 10:29:20 +02:00
parent 4de76ce87a
commit 3af25edfa5
1 changed files with 1 additions and 2 deletions

View File

@ -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});