Skip to content
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