aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llstartup.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-12-06 14:03:10 -0600
committerJacek Antonelli2008-12-06 14:03:10 -0600
commitb29b13ad98c5c79fd63bae10b4b099a03fa9dc35 (patch)
treeffc14fd638344c84287d1c4a72d2de5f765bf3c8 /linden/indra/newview/llstartup.cpp
parentopenal on windows branch (diff)
downloadmeta-impy-b29b13ad98c5c79fd63bae10b4b099a03fa9dc35.zip
meta-impy-b29b13ad98c5c79fd63bae10b4b099a03fa9dc35.tar.gz
meta-impy-b29b13ad98c5c79fd63bae10b4b099a03fa9dc35.tar.bz2
meta-impy-b29b13ad98c5c79fd63bae10b4b099a03fa9dc35.tar.xz
Updated audio engine to LL's openal branch r1532.
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llstartup.cpp51
1 files changed, 39 insertions, 12 deletions
diff --git a/linden/indra/newview/llstartup.cpp b/linden/indra/newview/llstartup.cpp
index 636cf31..11e4ac5 100644
--- a/linden/indra/newview/llstartup.cpp
+++ b/linden/indra/newview/llstartup.cpp
@@ -583,28 +583,55 @@ bool idle_startup()
583 583
584 if (FALSE == gSavedSettings.getBOOL("NoAudio")) 584 if (FALSE == gSavedSettings.getBOOL("NoAudio"))
585 { 585 {
586 586 gAudiop = NULL;
587 gAudiop = (LLAudioEngine *) new LLAudioEngine_OpenAL(); 587
588#ifdef LL_OPENAL
589 if (!gAudiop
590#if !LL_WINDOWS
591 && NULL == getenv("LL_BAD_OPENAL_DRIVER")
592#endif // !LL_WINDOWS
593 )
594 {
595 gAudiop = (LLAudioEngine *) new LLAudioEngine_OpenAL();
596 }
597#endif
598
599#ifdef LL_FMOD
600 if (!gAudiop
601#if !LL_WINDOWS
602 && NULL == getenv("LL_BAD_FMOD_DRIVER")
603#endif // !LL_WINDOWS
604 )
605 {
606 gAudiop = (LLAudioEngine *) new LLAudioEngine_FMOD();
607 }
608#endif
588 609
589 if (gAudiop) 610 if (gAudiop)
590 { 611 {
591 BOOL init = gAudiop->init(kAUDIO_NUM_SOURCES); 612#if LL_WINDOWS
592 if(!init) 613 // FMOD on Windows needs the window handle to stop playing audio
614 // when window is minimized. JC
615 void* window_handle = (HWND)gViewerWindow->getPlatformWindow();
616#else
617 void* window_handle = NULL;
618#endif
619 bool init = gAudiop->init(kAUDIO_NUM_SOURCES, window_handle);
620 if(init)
593 { 621 {
594 LL_WARNS("AppInit") << "Unable to initialize audio engine" << LL_ENDL; 622 gAudiop->setMuted(TRUE);
595 gAudiop=NULL;
596 } 623 }
597 else 624 else
598 { 625 {
599 gAudiop->setMuted(TRUE); 626 LL_WARNS("AppInit") << "Unable to initialize audio engine" << LL_ENDL;
600 LL_INFOS("AppInit") << "Audio Engine Initialized." << LL_ENDL; 627 delete gAudiop;
628 gAudiop = NULL;
601 } 629 }
602 } 630 }
603 } 631 }
604 else 632
605 { 633 LL_INFOS("AppInit") << "Audio Engine Initialized." << LL_ENDL;
606 gAudiop = NULL; 634
607 }
608 635
609 if (LLTimer::knownBadTimer()) 636 if (LLTimer::knownBadTimer())
610 { 637 {