Fix for EXT-3664/DEV-43374 (MEDIA SETTINGS Reset button does not work if current URL is a quicktime movie)

LLViewerMediaImpl::initializeMedia() was assuming an invalid invariant (that mMimeType was associated with the currently loaded plugin).  Fixed by adding a new member variable, mCurrentMimeType, which reflects the MIME type that caused the currently loaded plugin to be loaded, and using that instead of mMimeType when determining whether to reload the plugin.
meow-7.2.2
Monroe Linden 2010-01-05 16:16:57 -08:00
parent f119a86461
commit 34191fcc2c
2 changed files with 8 additions and 3 deletions

View File

@ -987,7 +987,7 @@ void LLViewerMediaImpl::emitEvent(LLPluginClassMedia* plugin, LLViewerMediaObser
bool LLViewerMediaImpl::initializeMedia(const std::string& mime_type)
{
bool mimeTypeChanged = (mMimeType != mime_type);
bool pluginChanged = (LLMIMETypes::implType(mMimeType) != LLMIMETypes::implType(mime_type));
bool pluginChanged = (LLMIMETypes::implType(mCurrentMimeType) != LLMIMETypes::implType(mime_type));
if(!mMediaSource || pluginChanged)
{
@ -1127,6 +1127,9 @@ bool LLViewerMediaImpl::initializePlugin(const std::string& media_type)
// If we got here, we want to ignore previous init failures.
mMediaSourceFailed = false;
// Save the MIME type that really caused the plugin to load
mCurrentMimeType = mMimeType;
LLPluginClassMedia* media_source = newSourceFromMediaType(mMimeType, this, mMediaWidth, mMediaHeight);
if (media_source)
@ -1563,6 +1566,7 @@ void LLViewerMediaImpl::unload()
mMediaURL.clear();
mMimeType.clear();
mCurrentMediaURL.clear();
mCurrentMimeType.clear();
}
//////////////////////////////////////////////////////////////////////////////////////////
@ -2123,7 +2127,7 @@ void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginCla
// TODO: may want a different message for this case?
LLSD args;
args["PLUGIN"] = LLMIMETypes::implType(mMimeType);
args["PLUGIN"] = LLMIMETypes::implType(mCurrentMimeType);
LLNotificationsUtil::add("MediaPluginFailed", args);
}
break;
@ -2137,7 +2141,7 @@ void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginCla
resetPreviousMediaState();
LLSD args;
args["PLUGIN"] = LLMIMETypes::implType(mMimeType);
args["PLUGIN"] = LLMIMETypes::implType(mCurrentMimeType);
// SJB: This is getting called every frame if the plugin fails to load, continuously respawining the alert!
//LLNotificationsUtil::add("MediaPluginFailed", args);
}

View File

@ -324,6 +324,7 @@ public:
std::string mHomeURL;
std::string mMimeType;
std::string mCurrentMediaURL; // The most current media url from the plugin (via the "location changed" or "navigate complete" events).
std::string mCurrentMimeType; // The MIME type that caused the currently loaded plugin to be loaded.
S32 mLastMouseX; // save the last mouse coord we get, so when we lose capture we can simulate a mouseup at that point.
S32 mLastMouseY;
S32 mMediaWidth;