Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "ao_coreaudio: switch to ao_read_data_nonblocking()" #13902

Merged
merged 1 commit into from
Apr 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion audio/out/ao_coreaudio.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ static OSStatus render_cb_lpcm(void *ctx, AudioUnitRenderActionFlags *aflags,

int64_t end = mp_time_ns();
end += p->hw_latency_ns + ca_get_latency(ts) + ca_frames_to_ns(ao, frames);
int samples = ao_read_data_nonblocking(ao, planes, frames, end);
int samples = ao_read_data(ao, planes, frames, end);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should not use samples returned from ao_read_data, which may be less than requested. The original implementation did not use it and always submit buffers of requested length to CoreAudio. CoreAudio expect the buffer length be equal to requested.


if (samples == 0)
*aflags |= kAudioUnitRenderAction_OutputIsSilence;
Expand Down