diff options
author | Monroe Linden <monroe@lindenlab.com> | 2010-03-17 13:03:37 -0700 |
---|---|---|
committer | Monroe Linden <monroe@lindenlab.com> | 2010-03-17 13:03:37 -0700 |
commit | b54c7b525b01bc137246b3a57ec9f8318d0c8f81 (patch) | |
tree | 3fe926251a1b0037509722010ce84c740d5e780d /indra/newview/llviewerparcelmediaautoplay.cpp | |
parent | 49bb6eebe879573fbada33c7fd6e25f323ab44ce (diff) |
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
Diffstat (limited to 'indra/newview/llviewerparcelmediaautoplay.cpp')
-rw-r--r-- | indra/newview/llviewerparcelmediaautoplay.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/indra/newview/llviewerparcelmediaautoplay.cpp b/indra/newview/llviewerparcelmediaautoplay.cpp index ad2723b66b..f55d6d89c4 100644 --- a/indra/newview/llviewerparcelmediaautoplay.cpp +++ b/indra/newview/llviewerparcelmediaautoplay.cpp @@ -86,6 +86,7 @@ BOOL LLViewerParcelMediaAutoPlay::tick() LLParcel *this_parcel = NULL; LLViewerRegion *this_region = NULL; std::string this_media_url; + std::string this_media_type; LLUUID this_media_texture_id; S32 this_parcel_id = 0; LLUUID this_region_id; @@ -101,7 +102,9 @@ BOOL LLViewerParcelMediaAutoPlay::tick() if (this_parcel) { - this_media_url = std::string(this_parcel->getMediaURL()); + this_media_url = this_parcel->getMediaURL(); + + this_media_type = this_parcel->getMediaType(); this_media_texture_id = this_parcel->getMediaID(); @@ -118,14 +121,15 @@ BOOL LLViewerParcelMediaAutoPlay::tick() mLastRegionID = this_region_id; } - mTimeInParcel += mPeriod; // increase mTimeInParcel by the amount of time between ticks + mTimeInParcel += mPeriod; // increase mTimeInParcel by the amount of time between ticks - if ((!mPlayed) && // if we've never played - (mTimeInParcel > AUTOPLAY_TIME) && // and if we've been here for so many seconds - (this_media_url.size() != 0) && // and if the parcel has media - (LLViewerParcelMedia::sMediaImpl.isNull())) // and if the media is not already playing + if ((!mPlayed) && // if we've never played + (mTimeInParcel > AUTOPLAY_TIME) && // and if we've been here for so many seconds + (!this_media_url.empty()) && // and if the parcel has media + (stricmp(this_media_type.c_str(), "none/none") != 0) && + (LLViewerParcelMedia::sMediaImpl.isNull())) // and if the media is not already playing { - if (this_media_texture_id.notNull()) // and if the media texture is good + if (this_media_texture_id.notNull()) // and if the media texture is good { LLViewerMediaTexture *image = LLViewerTextureManager::getMediaTexture(this_media_texture_id, FALSE) ; |