diff options
Diffstat (limited to 'indra/llaudio')
19 files changed, 35 insertions, 15 deletions
diff --git a/indra/llaudio/CMakeLists.txt b/indra/llaudio/CMakeLists.txt index 1b2bdb9888..1b2bdb9888 100644..100755 --- a/indra/llaudio/CMakeLists.txt +++ b/indra/llaudio/CMakeLists.txt diff --git a/indra/llaudio/llaudiodecodemgr.cpp b/indra/llaudio/llaudiodecodemgr.cpp index 6c97a64ed7..6c97a64ed7 100644..100755 --- a/indra/llaudio/llaudiodecodemgr.cpp +++ b/indra/llaudio/llaudiodecodemgr.cpp diff --git a/indra/llaudio/llaudiodecodemgr.h b/indra/llaudio/llaudiodecodemgr.h index e42fe8a40d..e42fe8a40d 100644..100755 --- a/indra/llaudio/llaudiodecodemgr.h +++ b/indra/llaudio/llaudiodecodemgr.h diff --git a/indra/llaudio/llaudioengine.cpp b/indra/llaudio/llaudioengine.cpp index 06e752cf34..06e752cf34 100644..100755 --- a/indra/llaudio/llaudioengine.cpp +++ b/indra/llaudio/llaudioengine.cpp diff --git a/indra/llaudio/llaudioengine.h b/indra/llaudio/llaudioengine.h index da1629a1db..da1629a1db 100644..100755 --- a/indra/llaudio/llaudioengine.h +++ b/indra/llaudio/llaudioengine.h diff --git a/indra/llaudio/llaudioengine_fmodex.cpp b/indra/llaudio/llaudioengine_fmodex.cpp index 5ec30c7d1d..fe6dedcd03 100644 --- a/indra/llaudio/llaudioengine_fmodex.cpp +++ b/indra/llaudio/llaudioengine_fmodex.cpp @@ -305,8 +305,11 @@ void LLAudioEngine_FMODEX::shutdown() LLAudioEngine::shutdown(); llinfos << "LLAudioEngine_FMODEX::shutdown() closing FMOD Ex" << llendl; - mSystem->close(); - mSystem->release(); + if ( mSystem ) // speculative fix for MAINT-2657 + { + mSystem->close(); + mSystem->release(); + } llinfos << "LLAudioEngine_FMODEX::shutdown() done closing FMOD Ex" << llendl; delete mListenerp; diff --git a/indra/llaudio/llaudioengine_openal.cpp b/indra/llaudio/llaudioengine_openal.cpp index 34a057dcc0..34a057dcc0 100644..100755 --- a/indra/llaudio/llaudioengine_openal.cpp +++ b/indra/llaudio/llaudioengine_openal.cpp diff --git a/indra/llaudio/llaudioengine_openal.h b/indra/llaudio/llaudioengine_openal.h index 6639d9dfe6..6639d9dfe6 100644..100755 --- a/indra/llaudio/llaudioengine_openal.h +++ b/indra/llaudio/llaudioengine_openal.h diff --git a/indra/llaudio/lllistener.cpp b/indra/llaudio/lllistener.cpp index df2366c8c2..df2366c8c2 100644..100755 --- a/indra/llaudio/lllistener.cpp +++ b/indra/llaudio/lllistener.cpp diff --git a/indra/llaudio/lllistener.h b/indra/llaudio/lllistener.h index 41836bf039..41836bf039 100644..100755 --- a/indra/llaudio/lllistener.h +++ b/indra/llaudio/lllistener.h diff --git a/indra/llaudio/lllistener_ds3d.h b/indra/llaudio/lllistener_ds3d.h index 9150ccd5b9..9150ccd5b9 100644..100755 --- a/indra/llaudio/lllistener_ds3d.h +++ b/indra/llaudio/lllistener_ds3d.h diff --git a/indra/llaudio/lllistener_openal.cpp b/indra/llaudio/lllistener_openal.cpp index b3d4b02f09..b3d4b02f09 100644..100755 --- a/indra/llaudio/lllistener_openal.cpp +++ b/indra/llaudio/lllistener_openal.cpp diff --git a/indra/llaudio/lllistener_openal.h b/indra/llaudio/lllistener_openal.h index cb163b11a5..cb163b11a5 100644..100755 --- a/indra/llaudio/lllistener_openal.h +++ b/indra/llaudio/lllistener_openal.h diff --git a/indra/llaudio/llstreamingaudio.h b/indra/llaudio/llstreamingaudio.h index 93479f9d59..93479f9d59 100644..100755 --- a/indra/llaudio/llstreamingaudio.h +++ b/indra/llaudio/llstreamingaudio.h diff --git a/indra/llaudio/llstreamingaudio_fmodex.cpp b/indra/llaudio/llstreamingaudio_fmodex.cpp index 4a74267650..42f30aa1c4 100644 --- a/indra/llaudio/llstreamingaudio_fmodex.cpp +++ b/indra/llaudio/llstreamingaudio_fmodex.cpp @@ -153,7 +153,6 @@ void LLStreamingAudio_FMODEX::update() // Reset volume to previously set volume setGain(getGain()); mFMODInternetStreamChannelp->setPaused(false); - mLastStarved.stop(); } } else if(open_state == FMOD_OPENSTATE_ERROR) @@ -168,21 +167,43 @@ void LLStreamingAudio_FMODEX::update() if(mFMODInternetStreamChannelp->getCurrentSound(&sound) == FMOD_OK && sound) { + FMOD_TAG tag; + S32 tagcount, dirtytagcount; + + if(sound->getNumTags(&tagcount, &dirtytagcount) == FMOD_OK && dirtytagcount) + { + for(S32 i = 0; i < tagcount; ++i) + { + if(sound->getTag(NULL, i, &tag)!=FMOD_OK) + continue; + + if (tag.type == FMOD_TAGTYPE_FMOD) + { + if (!strcmp(tag.name, "Sample Rate Change")) + { + llinfos << "Stream forced changing sample rate to " << *((float *)tag.data) << llendl; + mFMODInternetStreamChannelp->setFrequency(*((float *)tag.data)); + } + continue; + } + } + } + if(starving) { - if(!mLastStarved.getStarted()) + bool paused = false; + mFMODInternetStreamChannelp->getPaused(&paused); + if(!paused) { - llinfos << "Stream starvation detected! Muting stream audio until it clears." << llendl; + llinfos << "Stream starvation detected! Pausing stream until buffer nearly full." << llendl; llinfos << " (diskbusy="<<diskbusy<<")" << llendl; llinfos << " (progress="<<progress<<")" << llendl; - mFMODInternetStreamChannelp->setMute(true); + mFMODInternetStreamChannelp->setPaused(true); } - mLastStarved.start(); } - else if(mLastStarved.getStarted() && mLastStarved.getElapsedTimeF32() > 1.f) + else if(progress > 80) { - mLastStarved.stop(); - mFMODInternetStreamChannelp->setMute(false); + mFMODInternetStreamChannelp->setPaused(false); } } } @@ -190,8 +211,6 @@ void LLStreamingAudio_FMODEX::update() void LLStreamingAudio_FMODEX::stop() { - mLastStarved.stop(); - if (mFMODInternetStreamChannelp) { mFMODInternetStreamChannelp->setPaused(true); @@ -291,7 +310,7 @@ LLAudioStreamManagerFMODEX::LLAudioStreamManagerFMODEX(FMOD::System *system, con { mInternetStreamURL = url; - FMOD_RESULT result = mSystem->createStream(url.c_str(), FMOD_2D | FMOD_NONBLOCKING | FMOD_MPEGSEARCH | FMOD_IGNORETAGS, 0, &mInternetStream); + FMOD_RESULT result = mSystem->createStream(url.c_str(), FMOD_2D | FMOD_NONBLOCKING | FMOD_IGNORETAGS, 0, &mInternetStream); if (result!= FMOD_OK) { diff --git a/indra/llaudio/llstreamingaudio_fmodex.h b/indra/llaudio/llstreamingaudio_fmodex.h index 42b6b3aaa8..1dee18ae7d 100644 --- a/indra/llaudio/llstreamingaudio_fmodex.h +++ b/indra/llaudio/llstreamingaudio_fmodex.h @@ -67,8 +67,6 @@ private: std::string mURL; F32 mGain; - - LLTimer mLastStarved; }; diff --git a/indra/llaudio/llvorbisencode.cpp b/indra/llaudio/llvorbisencode.cpp index dfd5da12b3..dfd5da12b3 100644..100755 --- a/indra/llaudio/llvorbisencode.cpp +++ b/indra/llaudio/llvorbisencode.cpp diff --git a/indra/llaudio/llvorbisencode.h b/indra/llaudio/llvorbisencode.h index 6b22a2cb59..6b22a2cb59 100644..100755 --- a/indra/llaudio/llvorbisencode.h +++ b/indra/llaudio/llvorbisencode.h diff --git a/indra/llaudio/llwindgen.h b/indra/llaudio/llwindgen.h index 719b0ecbf2..719b0ecbf2 100644..100755 --- a/indra/llaudio/llwindgen.h +++ b/indra/llaudio/llwindgen.h |