summaryrefslogtreecommitdiff
path: root/indra/llaudio/llaudioengine_fmodex.cpp
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2013-06-03 18:06:45 -0400
committerOz Linden <oz@lindenlab.com>2013-06-03 18:06:45 -0400
commit9acabccdde5cff91cac3bae0502c8ff5b26cada6 (patch)
treeb6fc95044fc41cdc43969195f9c1939e8ecb0158 /indra/llaudio/llaudioengine_fmodex.cpp
parentdd2ede9991a9a31821fbe43a7fa17a5aafa19542 (diff)
parent7fa8c2313b47959ba8c0a40d92461f6892e0d0d3 (diff)
merge changes for 3.6.0-materials-beta1
Diffstat (limited to 'indra/llaudio/llaudioengine_fmodex.cpp')
-rw-r--r--indra/llaudio/llaudioengine_fmodex.cpp26
1 files changed, 18 insertions, 8 deletions
diff --git a/indra/llaudio/llaudioengine_fmodex.cpp b/indra/llaudio/llaudioengine_fmodex.cpp
index 0e789f9011..e9b74b8f41 100644
--- a/indra/llaudio/llaudioengine_fmodex.cpp
+++ b/indra/llaudio/llaudioengine_fmodex.cpp
@@ -67,7 +67,7 @@ inline bool Check_FMOD_Error(FMOD_RESULT result, const char *string)
{
if(result == FMOD_OK)
return false;
- llwarns << string << " Error: " << FMOD_ErrorString(result) << llendl;
+ lldebugs << string << " Error: " << FMOD_ErrorString(result) << llendl;
return true;
}
@@ -258,19 +258,29 @@ bool LLAudioEngine_FMODEX::init(const S32 num_channels, void* userdata)
int r_numbuffers, r_samplerate, r_channels, r_bits;
unsigned int r_bufferlength;
- char r_name[256];
mSystem->getDSPBufferSize(&r_bufferlength, &r_numbuffers);
+ LL_INFOS("AppInit") << "LLAudioEngine_FMODEX::init(): r_bufferlength=" << r_bufferlength << " bytes" << LL_ENDL;
+ LL_INFOS("AppInit") << "LLAudioEngine_FMODEX::init(): r_numbuffers=" << r_numbuffers << LL_ENDL;
+
mSystem->getSoftwareFormat(&r_samplerate, NULL, &r_channels, NULL, NULL, &r_bits);
- mSystem->getDriverInfo(0, r_name, 255, 0);
- r_name[255] = '\0';
- int latency = (int)(1000.0f * r_bufferlength * r_numbuffers / r_samplerate);
+ LL_INFOS("AppInit") << "LLAudioEngine_FMODEX::init(): r_samplerate=" << r_samplerate << "Hz" << LL_ENDL;
+ LL_INFOS("AppInit") << "LLAudioEngine_FMODEX::init(): r_channels=" << r_channels << LL_ENDL;
+ LL_INFOS("AppInit") << "LLAudioEngine_FMODEX::init(): r_bits =" << r_bits << LL_ENDL;
+
+ char r_name[512];
+ mSystem->getDriverInfo(0, r_name, 511, 0);
+ r_name[511] = '\0';
+ LL_INFOS("AppInit") << "LLAudioEngine_FMODEX::init(): r_name=\"" << r_name << "\"" << LL_ENDL;
- LL_INFOS("AppInit") << "FMOD device: "<< r_name << "\n"
- << "FMOD Ex parameters: " << r_samplerate << " Hz * " << r_channels << " * " <<r_bits <<" bit\n"
- << "\tbuffer " << r_bufferlength << " * " << r_numbuffers << " (" << latency <<"ms)" << LL_ENDL;
+ int latency = 100; // optimistic default - i suspect if sample rate is 0, everything breaks.
+ if ( r_samplerate != 0 )
+ latency = (int)(1000.0f * r_bufferlength * r_numbuffers / r_samplerate);
+ LL_INFOS("AppInit") << "LLAudioEngine_FMODEX::init(): latency=" << latency << "ms" << LL_ENDL;
mInited = true;
+ LL_INFOS("AppInit") << "LLAudioEngine_FMODEX::init(): initialization complete." << LL_ENDL;
+
return true;
}