summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llviewermedia.cpp33
-rw-r--r--indra/newview/llviewermedia.h1
-rw-r--r--indra/newview/llviewerparcelmedia.cpp6
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();