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.cpp51
1 files changed, 29 insertions, 22 deletions
diff --git a/indra/newview/llappviewermacosx.cpp b/indra/newview/llappviewermacosx.cpp
index 80d9b14345..0b5f18c330 100644
--- a/indra/newview/llappviewermacosx.cpp
+++ b/indra/newview/llappviewermacosx.cpp
@@ -44,7 +44,6 @@
#include "llviewernetwork.h"
#include "llviewercontrol.h"
#include "llmd5.h"
-#include "llurlsimstring.h"
#include "llfloaterworldmap.h"
#include "llurldispatcher.h"
#include <Carbon/Carbon.h>
@@ -291,6 +290,7 @@ static OSStatus CarbonEventHandler(EventHandlerCallRef inHandlerCallRef,
if(os_result >= 0 && matching_psn)
{
sCrashReporterIsRunning = false;
+ QuitApplicationEventLoop();
}
}
return noErr;
@@ -326,7 +326,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 +356,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 +451,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 +469,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 +490,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;