summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerparcelmediaautoplay.cpp
diff options
context:
space:
mode:
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) ;