mirror of
https://github.com/mpv-player/mpv
synced 2025-02-06 15:11:58 +00:00
ao_audiotrack: don't ignore ao_read_data return value
The difference this makes is that the OS API will notice when we underrun (as opposed to being fed silence). Other AOs mostly seem to not do this because they've committed to filling a buffer of a certain size no matter what, but I have not observed any ill effects for AudioTrack in my testing.
This commit is contained in:
parent
8b7904618e
commit
9faf9932a4
@ -575,8 +575,7 @@ static void *playthread(void *arg)
|
||||
ts += (read_samples / (double)(ao->samplerate)) * 1e6;
|
||||
ts += AudioTrack_getLatency(ao) * 1e6;
|
||||
int samples = ao_read_data(ao, &p->chunk, read_samples, ts);
|
||||
int write_samples = read_samples;
|
||||
int ret = AudioTrack_write(ao, write_samples * ao->sstride);
|
||||
int ret = AudioTrack_write(ao, samples * ao->sstride);
|
||||
if (ret >= 0) {
|
||||
p->written_frames += ret / ao->sstride;
|
||||
} else if (ret == AudioManager.ERROR_DEAD_OBJECT) {
|
||||
|
Loading…
Reference in New Issue
Block a user