Skip to content

Commit

Permalink
ao_avfoundation: handle case when ao_read_data returns zero samples
Browse files Browse the repository at this point in the history
  • Loading branch information
ruihe774 committed Mar 20, 2024
1 parent f98f61d commit 874c15a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions audio/out/ao_avfoundation.m
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 874c15a

Please sign in to comment.