diff --git a/audio/out/ao_avfoundation.m b/audio/out/ao_avfoundation.m index b8fff08036fea..9b6511afc2686 100644 --- a/audio/out/ao_avfoundation.m +++ b/audio/out/ao_avfoundation.m @@ -98,6 +98,10 @@ static void feed(struct ao *ao) if (real_sample_count == 0) { // in this case, we must satisfy renderer to avoid spining real_sample_count = ao_read_data(ao, data, request_sample_count, p->end_time_mp); + if (real_sample_count == 0) { + // ao_read_data may still return zero? + real_sample_count = request_sample_count; + } } CMSampleTimingInfo sample_timing_into[] = {(CMSampleTimingInfo) {