summaryrefslogtreecommitdiff
path: root/indra/newview/llappviewermacosx.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llappviewermacosx.cpp')
-rw-r--r--indra/newview/llappviewermacosx.cpp50
1 files changed, 29 insertions, 21 deletions
diff --git a/indra/newview/llappviewermacosx.cpp b/indra/newview/llappviewermacosx.cpp
index 80d9b14345..44ef39fb7d 100644
--- a/indra/newview/llappviewermacosx.cpp
+++ b/indra/newview/llappviewermacosx.cpp
@@ -291,6 +291,7 @@ static OSStatus CarbonEventHandler(EventHandlerCallRef inHandlerCallRef,
if(os_result >= 0 && matching_psn)
{
sCrashReporterIsRunning = false;
+ QuitApplicationEventLoop();
}
}
return noErr;
@@ -326,7 +327,7 @@ void LLAppViewerMacOSX::handleCrashReporting(bool reportFreeze)
// *NOTE:Mani A better way - make a copy of the data that the crash reporter will send
// and let SL go about its business. This way makes the mac work like windows and linux
// and is the smallest patch for the issue.
- sCrashReporterIsRunning = true;
+ sCrashReporterIsRunning = false;
ProcessSerialNumber o_psn;
static EventHandlerRef sCarbonEventsRef = NULL;
@@ -356,15 +357,13 @@ void LLAppViewerMacOSX::handleCrashReporting(bool reportFreeze)
if(os_result >= 0)
{
- EventRecord evt;
- while(sCrashReporterIsRunning)
- {
- while(WaitNextEvent(osMask, &evt, 0, NULL))
- {
- // null op!?!
- }
- }
- }
+ sCrashReporterIsRunning = true;
+ }
+
+ while(sCrashReporterIsRunning)
+ {
+ RunApplicationEventLoop();
+ }
// Re-install the apps quit handler.
AEInstallEventHandler(kCoreEventClass,
@@ -453,16 +452,17 @@ std::string LLAppViewerMacOSX::generateSerialNumber()
static AudioDeviceID get_default_audio_output_device(void)
{
AudioDeviceID device = 0;
- UInt32 size;
- OSStatus err;
-
- size = sizeof(device);
- err = AudioHardwareGetProperty(kAudioHardwarePropertyDefaultOutputDevice, &size, &device);
+ UInt32 size = sizeof(device);
+ AudioObjectPropertyAddress device_address = { kAudioHardwarePropertyDefaultOutputDevice,
+ kAudioObjectPropertyScopeGlobal,
+ kAudioObjectPropertyElementMaster };
+
+ OSStatus err = AudioObjectGetPropertyData(kAudioObjectSystemObject, &device_address, 0, NULL, &size, &device);
if(err != noErr)
{
LL_DEBUGS("SystemMute") << "Couldn't get default audio output device (0x" << std::hex << err << ")" << LL_ENDL;
}
-
+
return device;
}
@@ -470,11 +470,15 @@ static AudioDeviceID get_default_audio_output_device(void)
void LLAppViewerMacOSX::setMasterSystemAudioMute(bool new_mute)
{
AudioDeviceID device = get_default_audio_output_device();
-
+
if(device != 0)
{
UInt32 mute = new_mute;
- OSStatus err = AudioDeviceSetProperty(device, NULL, 0, false, kAudioDevicePropertyMute, sizeof(mute), &mute);
+ AudioObjectPropertyAddress device_address = { kAudioDevicePropertyMute,
+ kAudioDevicePropertyScopeOutput,
+ kAudioObjectPropertyElementMaster };
+
+ OSStatus err = AudioObjectSetPropertyData(device, &device_address, 0, NULL, sizeof(mute), &mute);
if(err != noErr)
{
LL_INFOS("SystemMute") << "Couldn't set audio mute property (0x" << std::hex << err << ")" << LL_ENDL;
@@ -487,13 +491,17 @@ bool LLAppViewerMacOSX::getMasterSystemAudioMute()
{
// Assume the system isn't muted
UInt32 mute = 0;
-
+
AudioDeviceID device = get_default_audio_output_device();
-
+
if(device != 0)
{
UInt32 size = sizeof(mute);
- OSStatus err = AudioDeviceGetProperty(device, 0, false, kAudioDevicePropertyMute, &size, &mute);
+ AudioObjectPropertyAddress device_address = { kAudioDevicePropertyMute,
+ kAudioDevicePropertyScopeOutput,
+ kAudioObjectPropertyElementMaster };
+
+ OSStatus err = AudioObjectGetPropertyData(device, &device_address, 0, NULL, &size, &mute);
if(err != noErr)
{
LL_DEBUGS("SystemMute") << "Couldn't get audio mute property (0x" << std::hex << err << ")" << LL_ENDL;