mirror of https://github.com/mpv-player/mpv
ao_audiotrack: switch to ao_read_data_nonblocking()
This commit is contained in:
parent
36d5b52612
commit
0b43b74c15
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue