summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerparcelmediaautoplay.cpp
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-03-23 14:08:11 +0000
committerTofu Linden <tofu.linden@lindenlab.com>2010-03-23 14:08:11 +0000
commite7d9999359dd62509c685181d620b092ed28bc60 (patch)
tree595bc367bef76b80d04f7e3e7d95dfbeb31a13cd /indra/newview/llviewerparcelmediaautoplay.cpp
parent11e6e208d43f1347037fb312921a65af138f47b4 (diff)
parentaf77b7713444b9df58f451bdb1f30bdd4754fcbf (diff)
Merge from viewer-2-0
Diffstat (limited to 'indra/newview/llviewerparcelmediaautoplay.cpp')
-rw-r--r--indra/newview/llviewerparcelmediaautoplay.cpp18
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) ;