diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 9421cf5716b5087ab4ab3834e399af9dd36e3f4c..aa7190459512bdf24fc6df9338e4a3d6e406ac75 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -2849,7 +2849,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
 										BOOL drop)
 {
 	LLInventoryModel* model = getInventoryModel();
-	if(!model) return FALSE;
+	if(!model || !inv_item) return FALSE;
 
 	// cannot drag into library
 	if(!isAgentInventory())
diff --git a/indra/newview/llmediadataclient.cpp b/indra/newview/llmediadataclient.cpp
index badef4c7ae8039213a6777fc5f6a3eb622f31bc3..3c337961e1af2bdec6a2737a99416187875d1714 100755
--- a/indra/newview/llmediadataclient.cpp
+++ b/indra/newview/llmediadataclient.cpp
@@ -260,7 +260,8 @@ void LLMediaDataClient::Responder::result(const LLSD& content)
 //
 //////////////////////////////////////////////////////////////////////////////////////
 
-bool LLMediaDataClient::Comparator::operator() (const request_ptr_t &o1, const request_ptr_t &o2) const
+// static
+bool LLMediaDataClient::compareRequests(const request_ptr_t &o1, const request_ptr_t &o2)
 {
 	if (o2.isNull()) return true;
 	if (o1.isNull()) return false;
@@ -277,20 +278,13 @@ bool LLMediaDataClient::Comparator::operator() (const request_ptr_t &o1, const r
 	// 3: One item with an impl, another without: item with impl wins 
 	//	  (XXX is that what we want?)		 
 	// Calculate the scores for each.  
-	F64 o1_score = Comparator::getObjectScore(o1->getObject());
-	F64 o2_score = Comparator::getObjectScore(o2->getObject());
-
-    // XXX Weird: a higher score should go earlier, but by observation I notice
-    // that this causes further-away objects load first.  This is counterintuitive
-    // to the priority_queue Comparator, which states that this function should
-    // return 'true' if o1 should be *before* o2.
-    // In other words, I'd have expected that the following should return
-    // ( o1_score > o2_score).
-	return ( o1_score < o2_score );
+	F64 o1_score = getObjectScore(o1->getObject());
+	F64 o2_score = getObjectScore(o2->getObject());
+	return ( o1_score > o2_score );
 }
-	
+
 // static
-F64 LLMediaDataClient::Comparator::getObjectScore(const LLMediaDataClientObject::ptr_t &obj)
+F64 LLMediaDataClient::getObjectScore(const LLMediaDataClientObject::ptr_t &obj)
 {
 	// *TODO: make this less expensive?
 	F64 dist = obj->getDistanceFromAvatar() + 0.1;	 // avoids div by 0
@@ -310,12 +304,12 @@ F64 LLMediaDataClient::Comparator::getObjectScore(const LLMediaDataClientObject:
 //////////////////////////////////////////////////////////////////////////////////////
 
 // dump the queue
-std::ostream& operator<<(std::ostream &s, const LLMediaDataClient::PriorityQueue &q)
+std::ostream& operator<<(std::ostream &s, const LLMediaDataClient::request_queue_t &q)
 {
 	int i = 0;
-	std::vector<LLMediaDataClient::request_ptr_t>::const_iterator iter = q.c.begin();
-	std::vector<LLMediaDataClient::request_ptr_t>::const_iterator end = q.c.end();
-	while (iter < end)
+	LLMediaDataClient::request_queue_t::const_iterator iter = q.begin();
+	LLMediaDataClient::request_queue_t::const_iterator end = q.end();
+	while (iter != end)
 	{
 		s << "\t" << i << "]: " << (*iter)->getObject()->getID().asString();
 		iter++;
@@ -325,11 +319,11 @@ std::ostream& operator<<(std::ostream &s, const LLMediaDataClient::PriorityQueue
 }
 
 // find the given object in the queue.
-bool LLMediaDataClient::PriorityQueue::find(const LLMediaDataClientObject::ptr_t &obj) const
+bool LLMediaDataClient::find(const LLMediaDataClientObject::ptr_t &obj) const
 {
-	std::vector<LLMediaDataClient::request_ptr_t>::const_iterator iter = c.begin();
-	std::vector<LLMediaDataClient::request_ptr_t>::const_iterator end = c.end();
-	while (iter < end)
+	request_queue_t::const_iterator iter = pRequestQueue->begin();
+	request_queue_t::const_iterator end = pRequestQueue->end();
+	while (iter != end)
 	{
 		if (obj->getID() == (*iter)->getObject()->getID())
 		{
@@ -370,13 +364,17 @@ BOOL LLMediaDataClient::QueueTimer::tick()
 		return TRUE;
 	}
 	
-	LLMediaDataClient::PriorityQueue &queue = *(mMDC->pRequestQueue);
+	request_queue_t &queue = *(mMDC->pRequestQueue);
 
 	if(!queue.empty())
 	{
 		LL_INFOS("LLMediaDataClient") << "QueueTimer::tick() started, queue is:	  " << queue << LL_ENDL;
-	}
 
+		// Re-sort the list every time...
+		// XXX Is this really what we want?
+		queue.sort(LLMediaDataClient::compareRequests);
+	}
+	
 	// quick retry loop for cases where we shouldn't wait for the next timer tick
 	while(true)
 	{
@@ -387,7 +385,7 @@ BOOL LLMediaDataClient::QueueTimer::tick()
 		}
 	
 		// Peel one off of the items from the queue, and execute request
-		request_ptr_t request = queue.top();
+		request_ptr_t request = queue.front();
 		llassert(!request.isNull());
 		const LLMediaDataClientObject *object = (request.isNull()) ? NULL : request->getObject();
 		bool performed_request = false;
@@ -398,7 +396,7 @@ BOOL LLMediaDataClient::QueueTimer::tick()
 		{
 			// This object has been marked dead.  Pop it and move on to the next item in the queue immediately.
 			LL_INFOS("LLMediaDataClient") << "Skipping " << *request << ": object is dead!" << LL_ENDL;
-			queue.pop();
+			queue.pop_front();
 			continue;	// jump back to the start of the quick retry loop
 		}
 
@@ -442,7 +440,7 @@ BOOL LLMediaDataClient::QueueTimer::tick()
 											  << mMDC->mMaxNumRetries << " tries...popping object id " << object->getID() << LL_ENDL; 
 				// XXX Should we bring up a warning dialog??
 			}
-			queue.pop();
+			queue.pop_front();
 		}
 		else {
 			request->incRetryCount();
@@ -451,7 +449,7 @@ BOOL LLMediaDataClient::QueueTimer::tick()
  		// end of quick retry loop -- any cases where we want to loop will use 'continue' to jump back to the start.
  		break;
 	}  
-	
+
 	LL_DEBUGS("LLMediaDataClient") << "QueueTimer::tick() finished, queue is now: " << (*(mMDC->pRequestQueue)) << LL_ENDL;
 
 	return queue.empty();
@@ -488,7 +486,7 @@ void LLMediaDataClient::enqueue(const Request *request)
 	LL_INFOS("LLMediaDataClient") << "Queuing request for " << *request << LL_ENDL;
 	// Push the request on the priority queue
 	// Sadly, we have to const-cast because items put into the queue are not const
-	pRequestQueue->push(const_cast<LLMediaDataClient::Request*>(request));
+	pRequestQueue->push_back(const_cast<LLMediaDataClient::Request*>(request));
 	LL_DEBUGS("LLMediaDataClient") << "Queue:" << (*pRequestQueue) << LL_ENDL;
 	// Start the timer if not already running
 	startQueueTimer();
@@ -508,7 +506,7 @@ LLMediaDataClient::LLMediaDataClient(F32 queue_timer_delay,
 	  mMaxNumRetries(max_retries),
 	  mQueueTimerIsRunning(false)
 {
-	pRequestQueue = new PriorityQueue();
+	pRequestQueue = new request_queue_t();
 }
 
 LLMediaDataClient::~LLMediaDataClient()
@@ -529,7 +527,7 @@ bool LLMediaDataClient::isEmpty() const
 
 bool LLMediaDataClient::isInQueue(const LLMediaDataClientObject::ptr_t &object) const
 {
-	return (NULL == pRequestQueue) ? false : pRequestQueue->find(object);
+	return (NULL == pRequestQueue) ? false : find(object);
 }
 
 //////////////////////////////////////////////////////////////////////////////////////
diff --git a/indra/newview/llmediadataclient.h b/indra/newview/llmediadataclient.h
index d5dd050111faec3400001a7cbed9b27316eb1745..812e9cbdec808b7308ba1ada10d0b4a5b400ecfc 100755
--- a/indra/newview/llmediadataclient.h
+++ b/indra/newview/llmediadataclient.h
@@ -195,30 +195,14 @@ class LLMediaDataClient : public LLRefCount
 	
 private:
 	
-	// Comparator for PriorityQueue
-	class Comparator
-	{
-	public:
-		bool operator() (const request_ptr_t &o1, const request_ptr_t &o2) const;
-	private:
-		static F64 getObjectScore(const LLMediaDataClientObject::ptr_t &obj);
-	};
+	typedef std::list<request_ptr_t> request_queue_t;
 	
-    // PriorityQueue
-	class PriorityQueue : public std::priority_queue<
-		request_ptr_t, 
-		std::vector<request_ptr_t>, 
-		Comparator >
-	{
-	public:
-		// Return whether the given object is in the queue
-		bool find(const LLMediaDataClientObject::ptr_t &obj) const;
-		
-		friend std::ostream& operator<<(std::ostream &s, const PriorityQueue &q);
-	};
+	// Comparator for sorting
+	static bool compareRequests(const request_ptr_t &o1, const request_ptr_t &o2);
+	static F64 getObjectScore(const LLMediaDataClientObject::ptr_t &obj);
     
 	friend std::ostream& operator<<(std::ostream &s, const Request &q);
-    friend std::ostream& operator<<(std::ostream &s, const PriorityQueue &q);
+	friend std::ostream& operator<<(std::ostream &s, const request_queue_t &q);
 
 	class QueueTimer : public LLEventTimer
 	{
@@ -232,6 +216,9 @@ class LLMediaDataClient : public LLRefCount
 		LLPointer<LLMediaDataClient> mMDC;
 	};
 
+	// Return whether the given object is in the queue
+	bool find(const LLMediaDataClientObject::ptr_t &obj) const;
+	
 	void startQueueTimer();
 	void stopQueueTimer();
 	void setIsRunning(bool val) { mQueueTimerIsRunning = val; }
@@ -242,7 +229,7 @@ class LLMediaDataClient : public LLRefCount
 	
 	bool mQueueTimerIsRunning;
 	
-	PriorityQueue *pRequestQueue;
+	request_queue_t *pRequestQueue;
 };
 
 
diff --git a/indra/newview/llpanelmediasettingsgeneral.cpp b/indra/newview/llpanelmediasettingsgeneral.cpp
index ad8a379cc1dd66bd5cd88af833196518db2d285c..9b1f71a9a963b6f070725d474a4073f385f281ba 100644
--- a/indra/newview/llpanelmediasettingsgeneral.cpp
+++ b/indra/newview/llpanelmediasettingsgeneral.cpp
@@ -387,17 +387,19 @@ void LLPanelMediaSettingsGeneral::preApply()
 //
 void LLPanelMediaSettingsGeneral::getValues( LLSD &fill_me_in )
 {
-    fill_me_in[LLMediaEntry::AUTO_LOOP_KEY] = mAutoLoop->getValue();
-    fill_me_in[LLMediaEntry::AUTO_PLAY_KEY] = mAutoPlay->getValue();
-    fill_me_in[LLMediaEntry::AUTO_SCALE_KEY] = mAutoScale->getValue();
-    fill_me_in[LLMediaEntry::AUTO_ZOOM_KEY] = mAutoZoom->getValue();
-    fill_me_in[LLMediaEntry::CONTROLS_KEY] = mControls->getCurrentIndex();
-    //Don't fill in current URL: this is only supposed to get changed via navigate
+	fill_me_in[LLMediaEntry::AUTO_LOOP_KEY] = mAutoLoop->getValue();
+	fill_me_in[LLMediaEntry::AUTO_PLAY_KEY] = mAutoPlay->getValue();
+	fill_me_in[LLMediaEntry::AUTO_SCALE_KEY] = mAutoScale->getValue();
+	fill_me_in[LLMediaEntry::AUTO_ZOOM_KEY] = mAutoZoom->getValue();
+	fill_me_in[LLMediaEntry::CONTROLS_KEY] = mControls->getCurrentIndex();
+	//Don't fill in current URL: this is only supposed to get changed via navigate
 	// fill_me_in[LLMediaEntry::CURRENT_URL_KEY] = mCurrentURL->getValue();
-    fill_me_in[LLMediaEntry::HEIGHT_PIXELS_KEY] = mHeightPixels->getValue();
-    fill_me_in[LLMediaEntry::HOME_URL_KEY] = mHomeURL->getValue();
-    fill_me_in[LLMediaEntry::FIRST_CLICK_INTERACT_KEY] = mFirstClick->getValue();
-    fill_me_in[LLMediaEntry::WIDTH_PIXELS_KEY] = mWidthPixels->getValue();
+	fill_me_in[LLMediaEntry::HEIGHT_PIXELS_KEY] = mHeightPixels->getValue();
+	// Don't fill in the home URL if it is the special "Multiple Media" string!
+	if (LLTrans::getString("Multiple Media") != mHomeURL->getValue())
+		fill_me_in[LLMediaEntry::HOME_URL_KEY] = mHomeURL->getValue();
+	fill_me_in[LLMediaEntry::FIRST_CLICK_INTERACT_KEY] = mFirstClick->getValue();
+	fill_me_in[LLMediaEntry::WIDTH_PIXELS_KEY] = mWidthPixels->getValue();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
diff --git a/indra/newview/llpanelprimmediacontrols.cpp b/indra/newview/llpanelprimmediacontrols.cpp
index 529912929d6274699058686226d411b07c0d4a8e..71c1b0cbb940f39d2f0f274a4ba7071eee393d3b 100644
--- a/indra/newview/llpanelprimmediacontrols.cpp
+++ b/indra/newview/llpanelprimmediacontrols.cpp
@@ -510,7 +510,7 @@ void LLPanelPrimMediaControls::updateShape()
 				mMediaProgressBar->setPercent(media_plugin->getProgressPercent());
 				gFocusMgr.setTopCtrl(mMediaProgressPanel);
 			}
-			else
+			else if (mMediaProgressPanel->getVisible())
 			{
 				mMediaProgressPanel->setVisible(false);
 				gFocusMgr.setTopCtrl(NULL);
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index 8c41133a3a8636d59451d6f22a5ec9a2bd7472b5..9dfdf3d5b14729f85ff10b4f71af3cc358b3df58 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -169,6 +169,12 @@ LOG_CLASS(LLMimeDiscoveryResponder);
 			completeAny(status, "text/html");
 		}
 		else
+		if(status == 404)
+		{
+			// Treat 404s like an html page.
+			completeAny(status, "text/html");
+		}
+		else
 		{
 			llwarns << "responder failed with status " << status << ", reason " << reason << llendl;
 		
diff --git a/indra/newview/skins/default/textures/icons/Stop_Off.png b/indra/newview/skins/default/textures/icons/Stop_Off.png
new file mode 100644
index 0000000000000000000000000000000000000000..3ee215d36f3957b1607bf985e141005a83fa4e16
Binary files /dev/null and b/indra/newview/skins/default/textures/icons/Stop_Off.png differ
diff --git a/indra/newview/skins/default/textures/icons/UnZoom_Off.png b/indra/newview/skins/default/textures/icons/UnZoom_Off.png
new file mode 100644
index 0000000000000000000000000000000000000000..c794113755046d7eef07ba2665deec0d75c8f500
Binary files /dev/null and b/indra/newview/skins/default/textures/icons/UnZoom_Off.png differ
diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml
index 99f6fc5cb304478fa3093afe46841a994022cf05..3576b6ed77c0d36f8c8d124f7f96b90293a51e4f 100644
--- a/indra/newview/skins/default/textures/textures.xml
+++ b/indra/newview/skins/default/textures/textures.xml
@@ -490,6 +490,9 @@ with the same filename but different name
   <texture name="Stepper_Up_Off" file_name="widgets/Stepper_Up_Off.png" preload="true" />
   <texture name="Stepper_Up_Press" file_name="widgets/Stepper_Up_Press.png" preload="true" />
 
+  <texture name="Stop_Off" file_name="icons/Stop_Off.png" preload="false" />
+  <texture name="Stop_Over" file_name="icons/Stop_Over.png" preload="false" />
+  <texture name="Stop_Press" file_name="icons/Stop_Press.png" preload="false" />
   <texture name="StopReload_Off" file_name="icons/StopReload_Off.png" preload="false" />
   <texture name="StopReload_Over" file_name="icons/StopReload_Over.png" preload="false" />
   <texture name="StopReload_Press" file_name="icons/StopReload_Press.png" preload="false" />
@@ -607,6 +610,15 @@ with the same filename but different name
   <texture name="Zoom_Off" file_name="icons/Zoom_Off.png" preload="false" />
   <texture name="Zoom_Over" file_name="icons/Zoom_Over.png" preload="false" />
   <texture name="Zoom_Press" file_name="icons/Zoom_Press.png" preload="false" />
+  <texture name="UnZoom_Off" file_name="icons/UnZoom_Off.png" preload="false" />
+  <texture name="UnZoom_Over" file_name="icons/UnZoom_Over.png" preload="false" />
+  <texture name="UnZoom_Press" file_name="icons/UnZoom_Press.png" preload="false" />
+  <texture name="PowerOn_Off" file_name="icons/PowerOn_Off.png" preload="false" />
+  <texture name="PowerOn_Over" file_name="icons/PowerOn_Over.png" preload="false" />
+  <texture name="PowerOn_Press" file_name="icons/PowerOn_Press.png" preload="false" />
+  <texture name="PowerOff_Off" file_name="icons/PowerOff_Off.png" preload="false" />
+  <texture name="PowerOff_Over" file_name="icons/PowerOff_Over.png" preload="false" />
+  <texture name="PowerOff_Press" file_name="icons/PowerOff_Press.png" preload="false" />
 
   <!--WARNING OLD ART *do not use*-->
 
diff --git a/indra/newview/skins/default/xui/en/panel_media_settings_general.xml b/indra/newview/skins/default/xui/en/panel_media_settings_general.xml
index 686f4ac1d5ebb281b06abb43828638da0c22015a..e00f654750cc6218378442a001a7c7e41821efe4 100644
--- a/indra/newview/skins/default/xui/en/panel_media_settings_general.xml
+++ b/indra/newview/skins/default/xui/en/panel_media_settings_general.xml
@@ -93,27 +93,19 @@
   </text>
   <combo_box 
    allow_text_entry="false" 
-   bottom_delta="-20" 
-   enabled="true" 
+   bottom_delta="-20"
    follows="left|top"
    height="18" 
    left="10" 
-   max_chars="20" 
-   mouse_opaque="true"
+   max_chars="20"
    name="controls" 
    width="120">
     <combo_item 
-	 type="string" 
-	 length="1" 
-	 enabled="true" 
 	 name="Standard" 
 	 value="Standard">
       Standard
     </combo_item>
     <combo_item 
-	 type="string" 
-	 length="1" 
-	 enabled="true" 
 	 name="Mini" 
 	 value="Mini">
       Mini
diff --git a/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml b/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml
index 88049fe7d1138970edb818b00f6fccd638546a69..af4c01185ae31f7d38a51cfff17cb99e254a5f92 100644
--- a/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml
+++ b/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml
@@ -3,7 +3,7 @@
 	follows="left|right|top|bottom"
 	name="MediaControls"
 	background_visible="false"
-	height="160"
+	height="192"
 	layout="topleft"
 	mouse_opaque="false"
 	width="800">
@@ -16,44 +16,6 @@
 	  layout="topleft"
 	  mouse_opaque="false"
 	  top="20" />
-  <layout_stack
-	  follows="left|right|bottom"
-	  height="32"
-	  layout="topleft"
-	  animate="false"
-	  left="0"
-	  orientation="horizontal"
-	  top="96">
-	<!-- outer layout_panels center the inner one -->
-	<layout_panel
-		width="0"
-		layout="topleft"
-		user_resize="false" />
-	<panel
-		name="media_progress_indicator"
-		height="22"
-		layout="topleft"
-		visible="false"
-		left="0"
-		top="0"
-		auto_resize="false"
-		user_resize="false"
-		min_width="100"
-		width="200">
-	  <progress_bar
-		  name="media_progress_bar"
-		  color_bar="1 1 1 0.96"
-		  follows="left|right|top"
-		  height="16"
-		  layout="topleft"
-		  left="0"
-		  tool_tip="Media is Loading"/>
-	</panel>
-	<layout_panel
-		width="0"
-		layout="topleft"
-		user_resize="false" />
-  </layout_stack>
   <layout_stack
 	  name="media_controls"
 	  follows="left|right"
@@ -152,9 +114,8 @@
 		top="2"
 		min_width="22"
 		width="22">
-	  <!-- The stop button here is temporary artwork -->
 	  <button
-		  image_overlay="media_btn_stoploading.png"
+		  image_overlay="Stop_Off"
 		  image_disabled="PushButton_Disabled"
 		  image_disabled_selected="PushButton_Disabled"
 		  image_selected="PushButton_Selected"
@@ -417,8 +378,8 @@ function="MediaCtrl.CommitURL" />
 		height="22"
 		min_width="22"
 		width="22">
-	  <!-- Note: this isn't quite right either...the mute button is not the -->
-	  <!-- same as the others because it can't have the "image_overlay" be  -->
+	  <!-- Note: this is not quite right either...the mute button is not the -->
+	  <!-- same as the others because it cannot have the "image_overlay" be  -->
 	  <!-- two different images.  -->
 	  <button
 		  image_disabled="PushButton_Disabled"
@@ -439,7 +400,7 @@ function="MediaCtrl.CommitURL" />
 			function="MediaCtrl.ToggleMute" />
 	  </button>
 	</layout_panel>
-	<!-- We don't have a design yet for "volume", so this is a temporary -->
+	<!-- We do not have a design yet for "volume", so this is a temporary -->
 	<!-- solution.  See DEV-42827. -->
 	<layout_panel
 		name="volume_up"
@@ -609,9 +570,8 @@ function="MediaCtrl.CommitURL" />
 		layout="topleft"
 		min_width="21"
 		width="21" >
-	  <!-- There is no "Zoom out" icon, so we use this temporarily -->
 	  <button
-		  image_overlay="ForwardArrow_Off"
+		  image_overlay="UnZoom_Off"
 		  image_disabled="PushButton_Disabled"
 		  image_disabled_selected="PushButton_Disabled"
 		  image_selected="PushButton_Selected"
@@ -657,4 +617,41 @@ function="MediaCtrl.CommitURL" />
 		layout="topleft"
 		user_resize="false" />
   </layout_stack>
+  <layout_stack
+	  follows="left|right|bottom"
+	  height="32"
+	  layout="topleft"
+	  animate="false"
+	  left="0"
+	  orientation="horizontal"
+	  top="150">
+	<!-- outer layout_panels center the inner one -->
+	<layout_panel
+		width="0"
+		layout="topleft"
+		user_resize="false" />
+	<panel
+		name="media_progress_indicator"
+		height="22"
+		layout="topleft"
+		left="0"
+		top="0"
+		auto_resize="false"
+		user_resize="false"
+		min_width="100"
+		width="200">
+	  <progress_bar
+		  name="media_progress_bar"
+		  color_bar="1 1 1 0.96"
+		  follows="left|right|top"
+		  height="8"
+		  layout="topleft"
+		  left="0"
+		  tool_tip="Media is Loading"/>
+	</panel>
+	<layout_panel
+		width="0"
+		layout="topleft"
+		user_resize="false" />
+  </layout_stack>
 </panel>
diff --git a/indra/newview/tests/llmediadataclient_test.cpp b/indra/newview/tests/llmediadataclient_test.cpp
index 217889c39005fc151774b0d015d040571b041b02..6ff2c9446e72d723e340d38d7c03786314d93d98 100644
--- a/indra/newview/tests/llmediadataclient_test.cpp
+++ b/indra/newview/tests/llmediadataclient_test.cpp
@@ -191,6 +191,12 @@ class LLMediaDataClientObjectTest : public LLMediaDataClientObject
 	virtual bool isDead() const
 		{ return mDead; }
 
+	void setDistanceFromAvatar(F64 val)
+		{ mRep["distance"] = val; }
+	
+	void setTotalMediaInterest(F64 val)
+		{ mRep["interest"] = val; }
+
 	int getNumBounceBacks() const
 		{ return mNumBounceBacks; }
 	
@@ -593,6 +599,91 @@ namespace tut
 
 			ensure("queue empty", mdc->isEmpty());
 		}
-		
+		ensure("refcount of o1", o1->getNumRefs(), 1);
+		ensure("refcount of o2", o2->getNumRefs(), 1);
+		ensure("refcount of o3", o3->getNumRefs(), 1);
+		ensure("refcount of o4", o4->getNumRefs(), 1);
+
 	}
+	
+	//////////////////////////////////////////////////////////////////////////////////////////
+
+    template<> template<>
+    void mediadataclient_object_t::test<9>()
+    {
+		//
+		// Test queue re-ordering
+		//
+		LOG_TEST(9);
+		
+		LLMediaDataClientObject::ptr_t o1 = new LLMediaDataClientObjectTest(_DATA(VALID_OBJECT_ID_1,"10.0","1.0"));
+		LLMediaDataClientObject::ptr_t o2 = new LLMediaDataClientObjectTest(_DATA(VALID_OBJECT_ID_2,"20.0","1.0"));
+		LLMediaDataClientObject::ptr_t o3 = new LLMediaDataClientObjectTest(_DATA(VALID_OBJECT_ID_3,"30.0","1.0"));
+		LLMediaDataClientObject::ptr_t o4 = new LLMediaDataClientObjectTest(_DATA(VALID_OBJECT_ID_4,"40.0","1.0"));
+		{
+			LLPointer<LLObjectMediaDataClient> mdc = new LLObjectMediaDataClient(NO_PERIOD,NO_PERIOD);
+			
+			// queue up all 4 objects.  They should now be in the queue in
+			// order 1 through 4, with 4 being at the front of the queue
+			mdc->fetchMedia(o1);
+			mdc->fetchMedia(o2);
+			mdc->fetchMedia(o3);
+			mdc->fetchMedia(o4);
+			
+			int test_num = 0;
+			
+			ensure(STR(test_num) + ". is in queue 1", mdc->isInQueue(o1));
+			ensure(STR(test_num) + ". is in queue 2", mdc->isInQueue(o2));
+			ensure(STR(test_num) + ". is in queue 3", mdc->isInQueue(o3));
+			ensure(STR(test_num) + ". is in queue 4", mdc->isInQueue(o4));
+			ensure(STR(test_num) + ". post records", gPostRecords->size(), 0);
+			
+			::pump_timers();
+			++test_num;
+			
+			// The first tick should remove the first one 
+			ensure(STR(test_num) + ". is not in queue 1", !mdc->isInQueue(o1));
+			ensure(STR(test_num) + ". is in queue 2", mdc->isInQueue(o2));
+			ensure(STR(test_num) + ". is in queue 3", mdc->isInQueue(o3));
+			ensure(STR(test_num) + ". is in queue 4", mdc->isInQueue(o4));
+			ensure(STR(test_num) + ". post records", gPostRecords->size(), 1);
+			
+			// Now, pretend that object 4 moved relative to the avatar such
+			// that it is now closest
+			static_cast<LLMediaDataClientObjectTest*>(
+				static_cast<LLMediaDataClientObject*>(o4))->setDistanceFromAvatar(5.0);
+			
+			::pump_timers();
+			++test_num;
+			
+			// The second tick should still pick off item 2, but then re-sort
+			// have picked off object 4
+			ensure(STR(test_num) + ". is in queue 2", mdc->isInQueue(o2));
+			ensure(STR(test_num) + ". is in queue 3", mdc->isInQueue(o3));
+			ensure(STR(test_num) + ". is not in queue 4", !mdc->isInQueue(o4));
+			ensure(STR(test_num) + ". post records", gPostRecords->size(), 2);
+
+			::pump_timers();
+			++test_num;
+			
+			// The third tick should pick off object 2
+			ensure(STR(test_num) + ". is not in queue 2", !mdc->isInQueue(o2));
+			ensure(STR(test_num) + ". is in queue 3", mdc->isInQueue(o3));
+			ensure(STR(test_num) + ". post records", gPostRecords->size(), 3);
+
+			// The fourth tick should pick off object 3
+			::pump_timers();
+			++test_num;
+
+			ensure(STR(test_num) + ". is not in queue 3", !mdc->isInQueue(o3));
+			ensure(STR(test_num) + ". post records", gPostRecords->size(), 4);
+
+			ensure("queue empty", mdc->isEmpty());
+		}
+		ensure("refcount of o1", o1->getNumRefs(), 1);
+		ensure("refcount of o2", o2->getNumRefs(), 1);
+		ensure("refcount of o3", o3->getNumRefs(), 1);
+		ensure("refcount of o4", o4->getNumRefs(), 1);
+    }
+	
 }
diff --git a/install.xml b/install.xml
index 1df8fd09f4b73ec65fc3ecfe33d5bf6008e5a5ba..cc4db90f484010c543d3983b34a43eb64bff2889 100644
--- a/install.xml
+++ b/install.xml
@@ -948,9 +948,9 @@ anguage Infrstructure (CLI) international standard</string>
           <key>darwin</key>
           <map>
             <key>md5sum</key>
-            <string>b40a13847ee773c9ee06f641fe0dd1c2</string>
+            <string>7f818f13faf7c02838fe66f7d27e1913</string>
             <key>url</key>
-            <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/llqtwebkit-darwin-20091023.tar.bz2</uri>
+            <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/llqtwebkit-darwin-20091124.tar.bz2</uri>
           </map>
           <key>linux</key>
           <map>
@@ -962,9 +962,9 @@ anguage Infrstructure (CLI) international standard</string>
           <key>windows</key>
           <map>
             <key>md5sum</key>
-            <string>6f2f911545e5906edc87f4f3cda423a1</string>
+            <string>92cff05661b5547caae7cc6c66d09870</string>
             <key>url</key>
-            <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/llqtwebkit-windows-20091023.tar.bz2</uri>
+            <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/llqtwebkit-windows-20091123.tar.bz2</uri>
           </map>
         </map>
       </map>