From 171c1a5c44decf293e9d67d29301bc629e77e88f Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Fri, 5 Dec 2014 18:41:08 -0500 Subject: [PATCH] Fix media controls loading entered urls twice as much. Thanks to Diva Canto for working with me on this! --- indra/newview/llmediactrl.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index 80ed404d3..e4bbcec50 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -565,9 +565,12 @@ void LLMediaCtrl::navigateTo( std::string url_in, std::string mime_type) if (ensureMediaSourceExists()) { - mCurrentNavUrl = url_in; - mMediaSource->setSize(mTextureWidth, mTextureHeight); - mMediaSource->navigateTo(url_in, mime_type, mime_type.empty()); + if (mCurrentNavUrl != url_in) + { + mCurrentNavUrl = url_in; + mMediaSource->setSize(mTextureWidth, mTextureHeight); + mMediaSource->navigateTo(url_in, mime_type, mime_type.empty()); + } } } @@ -970,6 +973,7 @@ void LLMediaCtrl::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) case MEDIA_EVENT_LOCATION_CHANGED: { LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_LOCATION_CHANGED, new uri is: " << self->getLocation() << LL_ENDL; + mCurrentNavUrl = self->getLocation(); }; break;