diff options
-rw-r--r-- | indra/llplugin/llpluginclassmedia.cpp | 4 | ||||
-rw-r--r-- | indra/newview/llmediactrl.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llviewermedia.cpp | 24 | ||||
-rw-r--r-- | indra/newview/llviewermedia.h | 2 |
4 files changed, 20 insertions, 12 deletions
diff --git a/indra/llplugin/llpluginclassmedia.cpp b/indra/llplugin/llpluginclassmedia.cpp index e6c901dd5c..217b6e074d 100644 --- a/indra/llplugin/llpluginclassmedia.cpp +++ b/indra/llplugin/llpluginclassmedia.cpp @@ -682,7 +682,7 @@ void LLPluginClassMedia::sendPickFileResponse(const std::string &file) { LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "pick_file_response"); message.setValue("file", file); - if(mPlugin->isBlocked()) + if(mPlugin && mPlugin->isBlocked()) { // If the plugin sent a blocking pick-file request, the response should unblock it. message.setValueBoolean("blocking_response", true); @@ -696,7 +696,7 @@ void LLPluginClassMedia::sendAuthResponse(bool ok, const std::string &username, message.setValueBoolean("ok", ok); message.setValue("username", username); message.setValue("password", password); - if(mPlugin->isBlocked()) + if(mPlugin && mPlugin->isBlocked()) { // If the plugin sent a blocking pick-file request, the response should unblock it. message.setValueBoolean("blocking_response", true); diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index 8d8f9dbebb..9493fddf50 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -1055,7 +1055,7 @@ void LLMediaCtrl::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) auth_request_params.substitutions = args; auth_request_params.payload = LLSD().with("media_id", mMediaTextureID); - auth_request_params.functor.function = boost::bind(&LLViewerMedia::onAuthSubmit, _1, _2, mMediaSource->getMediaPlugin()); + auth_request_params.functor.function = boost::bind(&LLViewerMedia::onAuthSubmit, _1, _2); LLNotifications::instance().add(auth_request_params); }; break; diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index dacd663f83..60608a2c28 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -1046,15 +1046,23 @@ bool LLViewerMedia::isParcelAudioPlaying() return (LLViewerMedia::hasParcelAudio() && gAudiop && LLAudioEngine::AUDIO_PLAYING == gAudiop->isInternetStreamPlaying()); } -void LLViewerMedia::onAuthSubmit(const LLSD& notification, const LLSD& response, LLPluginClassMedia* media) +void LLViewerMedia::onAuthSubmit(const LLSD& notification, const LLSD& response) { - if (response["ok"]) + LLViewerMediaImpl *impl = LLViewerMedia::getMediaImplFromTextureID(notification["payload"]["media_id"]); + if(impl) { - media->sendAuthResponse(true, response["username"], response["password"]); - } - else - { - media->sendAuthResponse(false, "", ""); + LLPluginClassMedia* media = impl->getMediaPlugin(); + if(media) + { + if (response["ok"]) + { + media->sendAuthResponse(true, response["username"], response["password"]); + } + else + { + media->sendAuthResponse(false, "", ""); + } + } } } @@ -3108,7 +3116,7 @@ void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginCla auth_request_params.substitutions = args; auth_request_params.payload = LLSD().with("media_id", mTextureId); - auth_request_params.functor.function = boost::bind(&LLViewerMedia::onAuthSubmit, _1, _2, plugin); + auth_request_params.functor.function = boost::bind(&LLViewerMedia::onAuthSubmit, _1, _2); LLNotifications::instance().add(auth_request_params); }; break; diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index 83fe790839..e2e342cc45 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -131,7 +131,7 @@ public: static bool isParcelMediaPlaying(); static bool isParcelAudioPlaying(); - static void onAuthSubmit(const LLSD& notification, const LLSD& response, LLPluginClassMedia* media); + static void onAuthSubmit(const LLSD& notification, const LLSD& response); // Clear all cookies for all plugins static void clearAllCookies(); |