From b54c7b525b01bc137246b3a57ec9f8318d0c8f81 Mon Sep 17 00:00:00 2001 From: Monroe Linden Date: Wed, 17 Mar 2010 13:03:37 -0700 Subject: Fix for EXT-5975: don't display a toast warning for none/none parcel media mime type Modified LLParcelMediaAutoPlay and LLParcelMedia so that it should no longer attempt to create media instances when the media type is set to "none/none". Also, made LLViewerParcelMedia::getURL() return an empty string when the media type is none/none, which should make the UI better reflect the fact that it won't be loaded. Reviewed by Callum at http://codereview.lindenlab.com/686010 --- indra/newview/llviewerparcelmedia.cpp | 49 ++++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 21 deletions(-) (limited to 'indra/newview/llviewerparcelmedia.cpp') diff --git a/indra/newview/llviewerparcelmedia.cpp b/indra/newview/llviewerparcelmedia.cpp index 2c5c0a37e8..b967436df6 100644 --- a/indra/newview/llviewerparcelmedia.cpp +++ b/indra/newview/llviewerparcelmedia.cpp @@ -210,25 +210,29 @@ void LLViewerParcelMedia::play(LLParcel* parcel) // A new impl will be created below. } } - - if(!sMediaImpl) + + // Don't ever try to play if the media type is set to "none/none" + if(stricmp(mime_type.c_str(), "none/none") != 0) { - 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, - media_width, - media_height, - media_auto_scale, - media_loop); - sMediaImpl->setIsParcelMedia(true); - sMediaImpl->navigateTo(media_url, mime_type, true); - } + if(!sMediaImpl) + { + 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, + media_width, + media_height, + media_auto_scale, + media_loop); + sMediaImpl->setIsParcelMedia(true); + sMediaImpl->navigateTo(media_url, mime_type, true); + } - //LLFirstUse::useMedia(); + //LLFirstUse::useMedia(); - LLViewerParcelMediaAutoPlay::playStarted(); + LLViewerParcelMediaAutoPlay::playStarted(); + } } // static @@ -312,11 +316,14 @@ std::string LLViewerParcelMedia::getURL() if(sMediaImpl.notNull()) url = sMediaImpl->getMediaURL(); - if (url.empty()) - url = LLViewerParcelMgr::getInstance()->getAgentParcel()->getMediaCurrentURL(); - - if (url.empty()) - url = LLViewerParcelMgr::getInstance()->getAgentParcel()->getMediaURL(); + if(stricmp(LLViewerParcelMgr::getInstance()->getAgentParcel()->getMediaType().c_str(), "none/none") != 0) + { + if (url.empty()) + url = LLViewerParcelMgr::getInstance()->getAgentParcel()->getMediaCurrentURL(); + + if (url.empty()) + url = LLViewerParcelMgr::getInstance()->getAgentParcel()->getMediaURL(); + } return url; } -- cgit v1.2.3