VirtualBox

Changeset 58919 in vbox for trunk/src/VBox/Devices/Audio


Ignore:
Timestamp:
Nov 30, 2015 10:24:22 AM (9 years ago)
Author:
vboxsync
Message:

Audio/CoreAudio: Always pass the associated stream for inClientData when removing a proeprty listener or it will not get removed and crash during shutdown when the property changes and the code was already unloaded. Remove two additional properties in the output path which were added.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Audio/DrvHostCoreAudio.cpp

    r58378 r58919  
    17261726#ifdef DEBUG
    17271727        err = AudioObjectRemovePropertyListener(pStreamIn->deviceID, &propAdr,
    1728                                                 drvHostCoreAudioRecordingAudioDevicePropertyChanged, NULL);
     1728                                                drvHostCoreAudioRecordingAudioDevicePropertyChanged, pStreamIn);
    17291729        /* Not Fatal */
    17301730        if (RT_UNLIKELY(err != noErr))
     
    17341734        propAdr.mSelector = kAudioDevicePropertyNominalSampleRate;
    17351735        err = AudioObjectRemovePropertyListener(pStreamIn->deviceID, &propAdr,
    1736                                                 drvHostCoreAudioRecordingAudioDevicePropertyChanged, NULL);
     1736                                                drvHostCoreAudioRecordingAudioDevicePropertyChanged, pStreamIn);
    17371737        /* Not Fatal */
    17381738        if (RT_UNLIKELY(err != noErr))
     
    17421742        {
    17431743            propAdr.mSelector = kAudioHardwarePropertyDefaultInputDevice;
    1744             err = AudioObjectRemovePropertyListener(pStreamIn->deviceID, &propAdr,
    1745                                                     drvHostCoreAudioDefaultDeviceChanged, NULL);
     1744            err = AudioObjectRemovePropertyListener(kAudioObjectSystemObject, &propAdr,
     1745                                                    drvHostCoreAudioDefaultDeviceChanged, pStreamIn);
    17461746            if (RT_LIKELY(err == noErr))
    17471747            {
     
    18181818
    18191819        OSStatus err;
     1820
     1821        /*
     1822         * Unregister playback device callbacks.
     1823         */
     1824        AudioObjectPropertyAddress propAdr = { kAudioDeviceProcessorOverload, kAudioObjectPropertyScopeGlobal,
     1825                                               kAudioObjectPropertyElementMaster };
     1826#ifdef DEBUG
     1827        err = AudioObjectRemovePropertyListener(pStreamOut->deviceID, &propAdr,
     1828                                                drvHostCoreAudioPlaybackAudioDevicePropertyChanged, pStreamOut);
     1829        /* Not Fatal */
     1830        if (RT_UNLIKELY(err != noErr))
     1831            LogRel(("CoreAudio: Failed to remove the processor overload listener (%RI32)\n", err));
     1832#endif /* DEBUG */
     1833
     1834        propAdr.mSelector = kAudioDevicePropertyNominalSampleRate;
     1835        err = AudioObjectRemovePropertyListener(pStreamOut->deviceID, &propAdr,
     1836                                                drvHostCoreAudioPlaybackAudioDevicePropertyChanged, pStreamOut);
     1837        /* Not Fatal */
     1838        if (RT_UNLIKELY(err != noErr))
     1839            LogRel(("CoreAudio: Failed to remove the sample rate changed listener (%RI32)\n", err));
     1840
    18201841        if (pStreamOut->fDefDevChgListReg)
    18211842        {
    1822             AudioObjectPropertyAddress propAdr = { kAudioHardwarePropertyDefaultOutputDevice, kAudioObjectPropertyScopeGlobal,
    1823                                                    kAudioObjectPropertyElementMaster };
    1824             err = AudioObjectRemovePropertyListener(pStreamOut->deviceID, &propAdr,
    1825                                                     drvHostCoreAudioDefaultDeviceChanged, NULL);
     1843            propAdr.mSelector = kAudioHardwarePropertyDefaultOutputDevice;
     1844            propAdr.mScope    = kAudioObjectPropertyScopeGlobal;
     1845            propAdr.mElement  = kAudioObjectPropertyElementMaster;
     1846            err = AudioObjectRemovePropertyListener(kAudioObjectSystemObject, &propAdr,
     1847                                                    drvHostCoreAudioDefaultDeviceChanged, pStreamOut);
    18261848            if (RT_LIKELY(err == noErr))
    18271849            {
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette