summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerparcelmedia.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2020-08-11 01:34:13 +0300
committerAndrey Lihatskiy <alihatskiy@productengine.com>2020-08-11 01:34:13 +0300
commit9406b757a36d409e93a0ccde0a1fea289a3e6118 (patch)
treebac8ea172ccf40ea836d1b750d73e5d2cc5e11e4 /indra/newview/llviewerparcelmedia.cpp
parentf554fe2ca74ddf275e47cdce8537e04ab40f9f95 (diff)
parent2e66c406d1767f26f968452e9ca5f5c0afa513b2 (diff)
Merge branch 'DRTVWR-501-maint' into DRTVWR-503-maint
# Conflicts: # indra/cmake/DirectX.cmake # indra/newview/llviewerparcelmedia.cpp # indra/newview/viewer_manifest.py
Diffstat (limited to 'indra/newview/llviewerparcelmedia.cpp')
-rw-r--r--indra/newview/llviewerparcelmedia.cpp39
1 files changed, 10 insertions, 29 deletions
diff --git a/indra/newview/llviewerparcelmedia.cpp b/indra/newview/llviewerparcelmedia.cpp
index 5a8110cd57..83b05e6b4d 100644
--- a/indra/newview/llviewerparcelmedia.cpp
+++ b/indra/newview/llviewerparcelmedia.cpp
@@ -52,7 +52,10 @@ mMediaParcelLocalID(0)
LLMessageSystem* msg = gMessageSystem;
msg->setHandlerFunc("ParcelMediaCommandMessage", parcelMediaCommandMessageHandler );
msg->setHandlerFunc("ParcelMediaUpdate", parcelMediaUpdateHandler );
- LLViewerParcelMediaAutoPlay::instance();
+
+ // LLViewerParcelMediaAutoPlay will regularly check and autoplay media,
+ // might be good idea to just integrate it into LLViewerParcelMedia
+ LLSingleton<LLViewerParcelMediaAutoPlay>::getInstance();
}
LLViewerParcelMedia::~LLViewerParcelMedia()
@@ -81,11 +84,13 @@ void LLViewerParcelMedia::update(LLParcel* parcel)
S32 parcelid = parcel->getLocalID();
LLUUID regionid = gAgent.getRegion()->getRegionID();
+ bool location_changed = false;
if (parcelid != mMediaParcelLocalID || regionid != mMediaRegionID)
{
LL_DEBUGS("Media") << "New parcel, parcel id = " << parcelid << ", region id = " << regionid << LL_ENDL;
mMediaParcelLocalID = parcelid;
mMediaRegionID = regionid;
+ location_changed = true;
}
std::string mediaUrl = std::string ( parcel->getMediaURL () );
@@ -103,7 +108,7 @@ void LLViewerParcelMedia::update(LLParcel* parcel)
if(mMediaImpl.isNull())
{
- play(parcel);
+ // media will be autoplayed by LLViewerParcelMediaAutoPlay
return;
}
@@ -112,8 +117,9 @@ void LLViewerParcelMedia::update(LLParcel* parcel)
|| ( mMediaImpl->getMediaTextureID() != parcel->getMediaID() )
|| ( mMediaImpl->getMimeType() != parcel->getMediaType() ))
{
- // Only play if the media types are the same.
- if(mMediaImpl->getMimeType() == parcel->getMediaType())
+ // Only play if the media types are the same and parcel stays same.
+ if(mMediaImpl->getMimeType() == parcel->getMediaType()
+ && !location_changed)
{
play(parcel);
}
@@ -129,25 +135,6 @@ void LLViewerParcelMedia::update(LLParcel* parcel)
stop();
}
}
- /*
- else
- {
- // no audio player, do a first use dialog if there is media here
- if (parcel)
- {
- std::string mediaUrl = std::string ( parcel->getMediaURL () );
- if (!mediaUrl.empty ())
- {
- if (gWarningSettings.getBOOL("QuickTimeInstalled"))
- {
- gWarningSettings.setBOOL("QuickTimeInstalled", FALSE);
-
- LLNotificationsUtil::add("NoQuickTime" );
- };
- }
- }
- }
- */
}
// static
@@ -160,12 +147,6 @@ void LLViewerParcelMedia::play(LLParcel* parcel)
if (!gSavedSettings.getBOOL("AudioStreamingMedia"))
return;
- // This test appears all over the code and really should be facotred out into a single
- // call that returns true/false (with option ask dialog) but that is outside of scope
- // for this work so we'll just directly.
- if (gSavedSettings.getS32("ParcelMediaAutoPlayEnable") == 0 )
- return;
-
std::string media_url = parcel->getMediaURL();
std::string media_current_url = parcel->getMediaCurrentURL();
std::string mime_type = parcel->getMediaType();