diff options
| author | Rick Pasetto <rick@lindenlab.com> | 2009-12-01 18:45:40 -0800 | 
|---|---|---|
| committer | Rick Pasetto <rick@lindenlab.com> | 2009-12-01 18:45:40 -0800 | 
| commit | b92fe4351c402759991c26510a2a35a3b4308999 (patch) | |
| tree | facf85c7f117d80585270c50f715e14397ecd7db | |
| parent | 1db0d32133f97b03a632f03fa78e198b7f00866b (diff) | |
| parent | 659dc5224e2f4b6ce90b4f739cc015befc098c12 (diff) | |
Automated merge with ssh://rick@hg.lindenlab.com/skolb/media
| -rw-r--r-- | indra/newview/llappviewer.cpp | 2 | ||||
| -rw-r--r-- | indra/newview/llviewermedia.cpp | 31 | ||||
| -rw-r--r-- | indra/newview/llviewermedia.h | 1 | ||||
| -rw-r--r-- | indra/newview/llviewertexturelist.cpp | 4 | ||||
| -rw-r--r-- | indra/newview/llviewerwindow.cpp | 4 | 
5 files changed, 35 insertions, 7 deletions
| diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index eb08707b61..84843138bf 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -899,6 +899,8 @@ bool LLAppViewer::init()  		loadEventHostModule(gSavedSettings.getS32("QAModeEventHostPort"));  	} +	LLViewerMedia::initClass(); +	  	return true;  } diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index d5fd23ac51..0bee2e3abb 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -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" @@ -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,24 @@ void LLViewerMedia::updateMedia()  } +// idle callback function...only here to provide a hop to updateMedia() +static void llviewermedia_updatemedia_thunk(void*) +{ +	LLViewerMedia::updateMedia(); +} + +////////////////////////////////////////////////////////////////////////////////////////// +// static +void LLViewerMedia::initClass() +{ +	gIdleCallbacks.addFunction(llviewermedia_updatemedia_thunk, NULL); +} +  //////////////////////////////////////////////////////////////////////////////////////////  // static  void LLViewerMedia::cleanupClass()  { -	// This is no longer necessary, since sViewerMediaImplList is no longer smart pointers. +	gIdleCallbacks.deleteFunction(llviewermedia_updatemedia_thunk, NULL);  }  ////////////////////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index e2d159304f..8acb485daf 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -99,6 +99,7 @@ class LLViewerMedia  		static void updateMedia();  		static bool isMusicPlaying(); +		static void initClass();  		static void cleanupClass();  		static void toggleMusicPlay(void*); diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index dbcf563010..5be7f2945f 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -614,10 +614,6 @@ void LLViewerTextureList::updateImages(F32 max_time)  			didone = image->doLoadedCallbacks();  		}  	} -	if (!gNoRender && !gGLManager.mIsDisabled) -	{ -		LLViewerMedia::updateMedia(); -	}  	updateImagesUpdateStats();  } diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 9ba056a17c..8529a93527 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -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();  	} | 
