summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermedia.cpp
diff options
context:
space:
mode:
authorMonroe Linden <monroe@lindenlab.com>2009-10-20 19:36:46 -0700
committerMonroe Linden <monroe@lindenlab.com>2009-10-20 19:36:46 -0700
commit6b4b69c234a9daf6ec2459065802604f4243e5c3 (patch)
tree5da44a16f7dba49a86a53f58c18e8f5b23b8d000 /indra/newview/llviewermedia.cpp
parenteaf27e7fac1ff462878da1983250e13aef931707 (diff)
Fix for clicking "home" or "reload" on a web media prim causing a flash of the underlying texture.
Diffstat (limited to 'indra/newview/llviewermedia.cpp')
-rw-r--r--indra/newview/llviewermedia.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index c9bfc1d296..a77570826a 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -640,13 +640,18 @@ void LLViewerMediaImpl::emitEvent(LLPluginClassMedia* plugin, LLViewerMediaObser
//////////////////////////////////////////////////////////////////////////////////////////
bool LLViewerMediaImpl::initializeMedia(const std::string& mime_type)
{
- if((mMediaSource == NULL) || (mMimeType != mime_type))
+ bool mimeTypeChanged = (mMimeType != mime_type);
+ bool pluginChanged = (LLMIMETypes::implType(mMimeType) != LLMIMETypes::implType(mime_type));
+
+ if(!mMediaSource || pluginChanged)
{
- if(! initializePlugin(mime_type))
- {
- // This may be the case where the plugin's priority is PRIORITY_UNLOADED
- return false;
- }
+ // We don't have a plugin at all, or the new mime type is handled by a different plugin than the old mime type.
+ (void)initializePlugin(mime_type);
+ }
+ else if(mimeTypeChanged)
+ {
+ // The same plugin should be able to handle the new media -- just update the stored mime type.
+ mMimeType = mime_type;
}
// play();