ao_audiotrack: switch to ao_read_data_nonblocking()

This commit is contained in:
Thomas Weißschuh 2023-11-05 09:12:42 +01:00 committed by sfan5
parent 36d5b52612
commit 0b43b74c15
1 changed files with 1 additions and 1 deletions

View File

@ -566,7 +566,7 @@ static MP_THREAD_VOID playthread(void *arg)
int64_t ts = mp_time_ns(); int64_t ts = mp_time_ns();
ts += MP_TIME_S_TO_NS(read_samples / (double)(ao->samplerate)); ts += MP_TIME_S_TO_NS(read_samples / (double)(ao->samplerate));
ts += MP_TIME_S_TO_NS(AudioTrack_getLatency(ao)); ts += MP_TIME_S_TO_NS(AudioTrack_getLatency(ao));
int samples = ao_read_data(ao, &p->chunk, read_samples, ts); int samples = ao_read_data_nonblocking(ao, &p->chunk, read_samples, ts);
int ret = AudioTrack_write(ao, samples * ao->sstride); int ret = AudioTrack_write(ao, samples * ao->sstride);
if (ret >= 0) { if (ret >= 0) {
p->written_frames += ret / ao->sstride; p->written_frames += ret / ao->sstride;