Skip to content

Don't call set_notification_runloop #178

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

Open
wants to merge 1 commit into
base: trailblazer
Choose a base branch
from
Open
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
19 changes: 0 additions & 19 deletions src/backend/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,24 +164,6 @@ impl From<CAChannelLabel> for mixer::Channel {
}
}

fn set_notification_runloop() {
let address = AudioObjectPropertyAddress {
mSelector: kAudioHardwarePropertyRunLoop,
mScope: kAudioObjectPropertyScopeGlobal,
mElement: kAudioObjectPropertyElementMaster,
};

// Ask HAL to manage its own thread for notification by setting the run_loop to NULL.
// Otherwise HAL may use main thread to fire notifications.
let run_loop: CFRunLoopRef = ptr::null_mut();
let size = mem::size_of::<CFRunLoopRef>();
let status =
audio_object_set_property_data(kAudioObjectSystemObject, &address, size, &run_loop);
if status != NO_ERR {
cubeb_log!("Could not make global CoreAudio notifications use their own thread.");
}
}

fn clamp_latency(latency_frames: u32) -> u32 {
cmp::max(
cmp::min(latency_frames, SAFE_MAX_LATENCY_FRAMES),
Expand Down Expand Up @@ -1955,7 +1937,6 @@ impl AudioUnitContext {

impl ContextOps for AudioUnitContext {
fn init(_context_name: Option<&CStr>) -> Result<Context> {
set_notification_runloop();
let ctx = Box::new(AudioUnitContext::new());
Ok(unsafe { Context::from_ptr(Box::into_raw(ctx) as *mut _) })
}
Expand Down