summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerparcelmediaautoplay.cpp
diff options
context:
space:
mode:
authorAndreyL ProductEngine <alihatskiy@productengine.com>2019-11-14 23:44:45 +0200
committerAndreyL ProductEngine <alihatskiy@productengine.com>2019-11-14 23:44:45 +0200
commit4dd3d230ec7a43845f1a72dfcc7152ab04550d8e (patch)
tree2f6f9feefa9bdd7dd6ee4595bf65ad1af038047e /indra/newview/llviewerparcelmediaautoplay.cpp
parentb1ceef6ea4abffdfb36844c3b8e469283edce229 (diff)
parent78bdf57ad6610b34389226bf941ba736ca0c2225 (diff)
Merged in lindenlab/viewer-release
Diffstat (limited to 'indra/newview/llviewerparcelmediaautoplay.cpp')
-rw-r--r--indra/newview/llviewerparcelmediaautoplay.cpp25
1 files changed, 3 insertions, 22 deletions
diff --git a/indra/newview/llviewerparcelmediaautoplay.cpp b/indra/newview/llviewerparcelmediaautoplay.cpp
index 57ee583eae..b5a76ccba2 100644
--- a/indra/newview/llviewerparcelmediaautoplay.cpp
+++ b/indra/newview/llviewerparcelmediaautoplay.cpp
@@ -51,29 +51,10 @@ LLViewerParcelMediaAutoPlay::LLViewerParcelMediaAutoPlay() :
{
}
-static LLViewerParcelMediaAutoPlay *sAutoPlay = NULL;
-
-// static
-void LLViewerParcelMediaAutoPlay::initClass()
-{
- if (!sAutoPlay)
- sAutoPlay = new LLViewerParcelMediaAutoPlay;
-}
-
-// static
-void LLViewerParcelMediaAutoPlay::cleanupClass()
-{
- if (sAutoPlay)
- delete sAutoPlay;
-}
-
// static
void LLViewerParcelMediaAutoPlay::playStarted()
{
- if (sAutoPlay)
- {
- sAutoPlay->mPlayed = TRUE;
- }
+ LLSingleton<LLViewerParcelMediaAutoPlay>::getInstance()->mPlayed = TRUE;
}
BOOL LLViewerParcelMediaAutoPlay::tick()
@@ -122,7 +103,7 @@ BOOL LLViewerParcelMediaAutoPlay::tick()
(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(), LLMIMETypes::getDefaultMimeType().c_str()) != 0) &&
- (LLViewerParcelMedia::sMediaImpl.isNull())) // and if the media is not already playing
+ (!LLViewerParcelMedia::getInstance()->hasParcelMedia())) // and if the media is not already playing
{
if (this_media_texture_id.notNull()) // and if the media texture is good
{
@@ -144,7 +125,7 @@ BOOL LLViewerParcelMediaAutoPlay::tick()
if (gSavedSettings.getBOOL("ParcelMediaAutoPlayEnable"))
{
// and last but not least, only play when autoplay is enabled
- LLViewerParcelMedia::play(this_parcel);
+ LLViewerParcelMedia::getInstance()->play(this_parcel);
}
}