summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermedia.cpp
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2026-09-01 18:35:23 +0800
committerErik Kundiman <erik@megapahit.org>2026-09-04 21:58:53 +0800
commit00bb3bb6f07660bd914d29a1389342bb3060d254 (patch)
tree431f574922494d2201718f13085f17bc6bd7fb42 /indra/newview/llviewermedia.cpp
parenta8636720129952c10cf49ab80da21bf8b340b96c (diff)
parent4ef9f8f14b35ed388c294d53767a0dca0e890924 (diff)
Merge remote-tracking branch 'secondlife/release/26.4' into 26.4
Diffstat (limited to 'indra/newview/llviewermedia.cpp')
-rw-r--r--indra/newview/llviewermedia.cpp71
1 files changed, 28 insertions, 43 deletions
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index 92bfc9e0f5..e95335a377 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -560,55 +560,34 @@ LLViewerMedia::impl_list &LLViewerMedia::getPriorityList()
// This is the predicate function used to sort sViewerMediaImplList by priority.
bool LLViewerMedia::priorityComparitor(const LLViewerMediaImpl* i1, const LLViewerMediaImpl* i2)
{
- if(i1->isForcedUnloaded() && !i2->isForcedUnloaded())
+ // isForcedUnloaded can be pricey, avoid a repeat,
+ // note that this one is specifically i2, when everything else is i1
+ // Consider making isForcedUnloaded cache the value temporarily?
+ bool i2_forced_unloaded = i2->isForcedUnloaded();
+ if (i1->isForcedUnloaded() != i2_forced_unloaded)
{
// Muted or failed items always go to the end of the list, period.
- return false;
- }
- else if(i2->isForcedUnloaded() && !i1->isForcedUnloaded())
- {
- // Muted or failed items always go to the end of the list, period.
- return true;
+ return i2_forced_unloaded;
}
- else if(i1->hasFocus())
+ else if(i1->hasFocus() != i2->hasFocus())
{
// The item with user focus always comes to the front of the list, period.
- return true;
+ return i1->hasFocus();
}
- else if(i2->hasFocus())
- {
- // The item with user focus always comes to the front of the list, period.
- return false;
- }
- else if(i1->isParcelMedia())
- {
- // The parcel media impl sorts above all other inworld media, unless one has focus.
- return true;
- }
- else if(i2->isParcelMedia())
+ else if(i1->isParcelMedia() != i2->isParcelMedia())
{
// The parcel media impl sorts above all other inworld media, unless one has focus.
- return false;
+ return i1->isParcelMedia();
}
- else if(i1->getUsedInUI() && !i2->getUsedInUI())
+ else if (i1->getUsedInUI() != i2->getUsedInUI())
{
- // i1 is a UI element, i2 is not. This makes i1 "less than" i2, so it sorts earlier in our list.
- return true;
+ // UI elements sort above inworld media.
+ return i1->getUsedInUI();
}
- else if(i2->getUsedInUI() && !i1->getUsedInUI())
- {
- // i2 is a UI element, i1 is not. This makes i2 "less than" i1, so it sorts earlier in our list.
- return false;
- }
- else if(i1->isPlayable() && !i2->isPlayable())
- {
- // Playable items sort above ones that wouldn't play even if they got high enough priority
- return true;
- }
- else if(!i1->isPlayable() && i2->isPlayable())
+ else if (i1->isPlayable() != i2->isPlayable())
{
// Playable items sort above ones that wouldn't play even if they got high enough priority
- return false;
+ return i1->isPlayable();
}
else if(i1->getInterest() == i2->getInterest())
{
@@ -1821,6 +1800,13 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_
}
else
{
+#if LL_LINUX || __FreeBSD__
+ if(plugin_basename == "media_plugin_gstreamer10" && gSavedSettings.getBOOL("MediaPluginForceVLC"))
+ {
+ plugin_basename = "media_plugin_libvlc";
+ }
+#endif
+
std::string launcher_name = gDirUtilp->getLLPluginLauncher();
std::string plugin_name = gDirUtilp->getLLPluginFilename(plugin_basename);
#if __FreeBSD__
@@ -1835,12 +1821,11 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_
user_data_path_cache += gDirUtilp->getDirDelimiter();
// See if the plugin executable exists
- llstat s;
- if(LLFile::stat(launcher_name, &s))
+ if (!LLFile::isfile(launcher_name))
{
LL_WARNS_ONCE("Media") << "Couldn't find launcher at " << launcher_name << LL_ENDL;
}
- else if(LLFile::stat(plugin_name, &s))
+ else if (!LLFile::isfile(plugin_name))
{
LL_WARNS_ONCE("Media") << "Couldn't find plugin at " << plugin_name << LL_ENDL;
}
@@ -3658,7 +3643,7 @@ LLViewerMediaImpl::canUndo() const
if (mMediaSource)
return mMediaSource->canUndo();
else
- return FALSE;
+ return false;
}
////////////////////////////////////////////////////////////////////////////////
@@ -3678,7 +3663,7 @@ LLViewerMediaImpl::canRedo() const
if (mMediaSource)
return mMediaSource->canRedo();
else
- return FALSE;
+ return false;
}
////////////////////////////////////////////////////////////////////////////////
@@ -3758,7 +3743,7 @@ LLViewerMediaImpl::canDoDelete() const
if (mMediaSource)
return mMediaSource->canDoDelete();
else
- return FALSE;
+ return false;
}
////////////////////////////////////////////////////////////////////////////////
@@ -3778,7 +3763,7 @@ LLViewerMediaImpl::canSelectAll() const
if (mMediaSource)
return mMediaSource->canSelectAll();
else
- return FALSE;
+ return false;
}
void LLViewerMediaImpl::setUpdated(bool updated)