diff options
author | Monroe Linden <monroe@lindenlab.com> | 2009-10-08 19:53:55 -0700 |
---|---|---|
committer | Monroe Linden <monroe@lindenlab.com> | 2009-10-08 19:53:55 -0700 |
commit | 8d1f3f735194775b754011de1f6000ccb6d1039e (patch) | |
tree | 84f5180d6b5cb4fe767e2f82b628ff5ff527e3a5 /indra | |
parent | bf82ec22647736333e1b14766e3c7d5cfb1a739a (diff) |
Fix for some parcel media not loading properly (DEV-39135).
There were a couple of issues interacting to cause this:
Firstly, when LLViewerMediaImpl delayed loading the parcel media (which it normally does), it was losing track of the specified MIME type, but the autodiscovery code also wasn't being triggered. The code should now carry through both the specified MIME type and the autodiscovery flag when loading is delayed.
Second, the new media autodiscovery code might not work for some legacy parcel media content (for example, if it's stored on a server that doesn't report the correct MIME types). The code has been changed to first check whether the specified MIME type maps to a known plugin and allow that to override MIME type detection, which should allow this legacy content to keep working.
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llviewermedia.cpp | 33 | ||||
-rw-r--r-- | indra/newview/llviewermedia.h | 1 | ||||
-rw-r--r-- | indra/newview/llviewerparcelmedia.cpp | 6 |
3 files changed, 28 insertions, 12 deletions
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 67c198d3b9..2f55be8b9c 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -588,6 +588,7 @@ LLViewerMediaImpl::LLViewerMediaImpl( const LLUUID& texture_id, mHasFocus(false), mPriority(LLPluginClassMedia::PRIORITY_UNLOADED), mDoNavigateOnLoad(false), + mDoNavigateOnLoadRediscoverType(false), mDoNavigateOnLoadServerRequest(false), mMediaSourceFailedInit(false), mIsUpdated(false) @@ -665,7 +666,7 @@ void LLViewerMediaImpl::createMediaSource() { if(! mMediaURL.empty()) { - navigateTo(mMediaURL, mMimeType, false, mDoNavigateOnLoadServerRequest); + navigateTo(mMediaURL, mMimeType, mDoNavigateOnLoadRediscoverType, mDoNavigateOnLoadServerRequest); } else if(! mMimeType.empty()) { @@ -1010,14 +1011,7 @@ BOOL LLViewerMediaImpl::handleMouseUp(S32 x, S32 y, MASK mask) ////////////////////////////////////////////////////////////////////////////////////////// void LLViewerMediaImpl::navigateHome() { - mMediaURL = mHomeURL; - mDoNavigateOnLoad = !mMediaURL.empty(); - mDoNavigateOnLoadServerRequest = false; - - if(mMediaSource) - { - mMediaSource->loadURI( mHomeURL ); - } + navigateTo(mHomeURL, "", true, false); } ////////////////////////////////////////////////////////////////////////////////////////// @@ -1032,12 +1026,16 @@ void LLViewerMediaImpl::navigateTo(const std::string& url, const std::string& mi setNavState(MEDIANAVSTATE_NONE); } - // Always set the current URL. + // Always set the current URL and MIME type. mMediaURL = url; + mMimeType = mime_type; // If the current URL is not null, make the instance do a navigate on load. mDoNavigateOnLoad = !mMediaURL.empty(); + // if mime type discovery was requested, we'll need to do it when the media loads + mDoNavigateOnLoadRediscoverType = rediscover_type; + // and if this was a server request, the navigate on load will also need to be one. mDoNavigateOnLoadServerRequest = server_request; @@ -1048,6 +1046,21 @@ void LLViewerMediaImpl::navigateTo(const std::string& url, const std::string& mi return; } + + // If the caller has specified a non-empty MIME type, look that up in our MIME types list. + // If we have a plugin for that MIME type, use that instead of attempting auto-discovery. + // This helps in supporting legacy media content where the server the media resides on returns a bogus MIME type + // but the parcel owner has correctly set the MIME type in the parcel media settings. + + if(!mMimeType.empty() && (mMimeType != "none/none")) + { + std::string plugin_basename = LLMIMETypes::implType(mMimeType); + if(!plugin_basename.empty()) + { + // We have a plugin for this mime type + rediscover_type = false; + } + } if(rediscover_type) { diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index d534ef97b9..37aabcf2d6 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -278,6 +278,7 @@ public: bool mHasFocus; LLPluginClassMedia::EPriority mPriority; bool mDoNavigateOnLoad; + bool mDoNavigateOnLoadRediscoverType; bool mDoNavigateOnLoadServerRequest; bool mMediaSourceFailedInit; diff --git a/indra/newview/llviewerparcelmedia.cpp b/indra/newview/llviewerparcelmedia.cpp index 6fba909983..9bcdcbf9ad 100644 --- a/indra/newview/llviewerparcelmedia.cpp +++ b/indra/newview/llviewerparcelmedia.cpp @@ -226,11 +226,13 @@ void LLViewerParcelMedia::play(LLParcel* parcel) media_height, media_auto_scale, media_loop); - sMediaImpl->navigateTo(media_url); + sMediaImpl->navigateTo(media_url, mime_type, true); } } else { + LL_DEBUGS("Media") << "new media impl with mime type " << mime_type << ", url " << media_url << LL_ENDL; + // There is no media impl, make a new one sMediaImpl = LLViewerMedia::newMediaImpl( placeholder_texture_id, @@ -238,7 +240,7 @@ void LLViewerParcelMedia::play(LLParcel* parcel) media_height, media_auto_scale, media_loop); - sMediaImpl->navigateTo(media_url); + sMediaImpl->navigateTo(media_url, mime_type, true); } LLFirstUse::useMedia(); |