Automated merge with ssh://rick@hg.lindenlab.com/skolb/media

meow-7.2.2
Rick Pasetto 2009-12-02 12:17:45 -08:00
commit b5fa4a6d0d
5 changed files with 31 additions and 9 deletions

View File

@ -899,6 +899,8 @@ bool LLAppViewer::init()
loadEventHostModule(gSavedSettings.getS32("QAModeEventHostPort"));
}
LLViewerMedia::initClass();
return true;
}

View File

@ -45,6 +45,9 @@
#include "llviewertexturelist.h"
#include "llvovolume.h"
#include "llpluginclassmedia.h"
#include "llviewerwindow.h"
#include "llfocusmgr.h"
#include "llcallbacklist.h"
#include "llevent.h" // LLSimpleListener
#include "llnotificationsutil.h"
@ -625,7 +628,7 @@ static bool proximity_comparitor(const LLViewerMediaImpl* i1, const LLViewerMedi
//////////////////////////////////////////////////////////////////////////////////////////
// static
void LLViewerMedia::updateMedia()
void LLViewerMedia::updateMedia(void *dummy_arg)
{
impl_list::iterator iter = sViewerMediaImplList.begin();
impl_list::iterator end = sViewerMediaImplList.end();
@ -747,6 +750,19 @@ void LLViewerMedia::updateMedia()
impl_count_total++;
}
// Overrides if the window is minimized or we lost focus (taking care
// not to accidentally "raise" the priority either)
if (!gViewerWindow->getActive() /* viewer window minimized? */
&& new_priority > LLPluginClassMedia::PRIORITY_HIDDEN)
{
new_priority = LLPluginClassMedia::PRIORITY_HIDDEN;
}
else if (!gFocusMgr.getAppHasFocus() /* viewer window lost focus? */
&& new_priority > LLPluginClassMedia::PRIORITY_LOW)
{
new_priority = LLPluginClassMedia::PRIORITY_LOW;
}
pimpl->setPriority(new_priority);
if(pimpl->getUsedInUI())
@ -783,11 +799,18 @@ void LLViewerMedia::updateMedia()
}
//////////////////////////////////////////////////////////////////////////////////////////
// static
void LLViewerMedia::initClass()
{
gIdleCallbacks.addFunction(LLViewerMedia::updateMedia, NULL);
}
//////////////////////////////////////////////////////////////////////////////////////////
// static
void LLViewerMedia::cleanupClass()
{
// This is no longer necessary, since sViewerMediaImplList is no longer smart pointers.
gIdleCallbacks.deleteFunction(LLViewerMedia::updateMedia, NULL);
}
//////////////////////////////////////////////////////////////////////////////////////////

View File

@ -96,9 +96,10 @@ class LLViewerMedia
static bool textureHasMedia(const LLUUID& texture_id);
static void setVolume(F32 volume);
static void updateMedia();
static void updateMedia(void* dummy_arg = NULL);
static bool isMusicPlaying();
static void initClass();
static void cleanupClass();
static void toggleMusicPlay(void*);

View File

@ -614,10 +614,6 @@ void LLViewerTextureList::updateImages(F32 max_time)
didone = image->doLoadedCallbacks();
}
}
if (!gNoRender && !gGLManager.mIsDisabled)
{
LLViewerMedia::updateMedia();
}
updateImagesUpdateStats();
}

View File

@ -1011,6 +1011,7 @@ BOOL LLViewerWindow::handleActivate(LLWindow *window, BOOL activated)
else
{
mActive = FALSE;
if (gSavedSettings.getBOOL("AllowIdleAFK"))
{
gAgent.setAFK();
@ -3244,8 +3245,7 @@ LLPickInfo LLViewerWindow::pickImmediate(S32 x, S32 y_from_bot, BOOL pick_trans
}
else
{
llwarns << "List of last picks is empty" << llendl;
llwarns << "Using stub pick" << llendl;
lldebugs << "List of last picks is empty: Using stub pick" << llendl;
mLastPick = LLPickInfo();
}