@@ -732,7 +732,6 @@ impl AliveListener {
732
732
/// Get the pid of the process that currently owns exclusive access to a device.
733
733
/// A pid value of -1 means no process owns exclusive access.
734
734
pub fn get_hogging_pid ( device_id : AudioDeviceID ) -> Result < pid_t , Error > {
735
- // Get available formats.
736
735
let property_address = AudioObjectPropertyAddress {
737
736
mSelector : kAudioDevicePropertyHogMode,
738
737
mScope : kAudioObjectPropertyScopeGlobal,
@@ -763,14 +762,12 @@ pub fn get_hogging_pid(device_id: AudioDeviceID) -> Result<pid_t, Error> {
763
762
/// Returns the pid of the new owning process.
764
763
/// A pid value of -1 means no process owns exclusive access.
765
764
pub fn toggle_hog_mode ( device_id : AudioDeviceID ) -> Result < pid_t , Error > {
766
- // Get available formats.
767
765
let property_address = AudioObjectPropertyAddress {
768
766
mSelector : kAudioDevicePropertyHogMode,
769
767
mScope : kAudioObjectPropertyScopeGlobal,
770
768
mElement : kAudioObjectPropertyElementMaster,
771
769
} ;
772
770
let pid = unsafe {
773
- //let temp_pid: pid_t = std::process::id() as _;
774
771
let temp_pid: pid_t = -1 ;
775
772
let data_size = mem:: size_of :: < pid_t > ( ) ;
776
773
let status = AudioObjectSetPropertyData (
0 commit comments