aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llmedia/llmediaimplgstreamer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/llmedia/llmediaimplgstreamer.cpp')
-rw-r--r--linden/indra/llmedia/llmediaimplgstreamer.cpp26
1 files changed, 14 insertions, 12 deletions
diff --git a/linden/indra/llmedia/llmediaimplgstreamer.cpp b/linden/indra/llmedia/llmediaimplgstreamer.cpp
index 5978ba3..d1bab29 100644
--- a/linden/indra/llmedia/llmediaimplgstreamer.cpp
+++ b/linden/indra/llmedia/llmediaimplgstreamer.cpp
@@ -5,7 +5,7 @@
5 * 5 *
6 * $LicenseInfo:firstyear=2007&license=viewergpl$ 6 * $LicenseInfo:firstyear=2007&license=viewergpl$
7 * 7 *
8 * Copyright (c) 2007-2008, Linden Research, Inc. 8 * Copyright (c) 2007-2009, Linden Research, Inc.
9 * 9 *
10 * Second Life Viewer Source Code 10 * Second Life Viewer Source Code
11 * The source code in this file ("Source Code") is provided by Linden Lab 11 * The source code in this file ("Source Code") is provided by Linden Lab
@@ -591,9 +591,6 @@ bool LLMediaImplGStreamer::navigateTo (const std::string urlIn)
591 591
592 mState = GST_STATE_READY; 592 mState = GST_STATE_READY;
593 593
594 // navigateTo implicitly plays, too.
595 play();
596
597 return true; 594 return true;
598} 595}
599 596
@@ -792,6 +789,13 @@ bool LLMediaImplGStreamer::play()
792 if (!mPlaybin || mState == GST_STATE_NULL) 789 if (!mPlaybin || mState == GST_STATE_NULL)
793 return true; 790 return true;
794 791
792
793 if( getState() == GST_STATE_PLAYING )
794 {
795 LL_DEBUGS("MediaImpl") << "... but already playing." << LL_ENDL;
796 return true;
797 }
798
795 // Clean up the existing thread, if any. 799 // Clean up the existing thread, if any.
796 if( mPlayThread != NULL && mPlayThread->isStopped()) 800 if( mPlayThread != NULL && mPlayThread->isStopped())
797 { 801 {
@@ -813,9 +817,6 @@ bool LLMediaImplGStreamer::play()
813 817
814void LLMediaImplGStreamer::startPlay() 818void LLMediaImplGStreamer::startPlay()
815{ 819{
816 GstElement *pipeline = (GstElement *)gst_object_ref(GST_OBJECT(mPlaybin));
817 gst_object_unref(pipeline);
818
819 GstStateChangeReturn state_change; 820 GstStateChangeReturn state_change;
820 821
821 state_change = gst_element_set_state(mPlaybin, GST_STATE_PLAYING); 822 state_change = gst_element_set_state(mPlaybin, GST_STATE_PLAYING);
@@ -894,18 +895,19 @@ bool LLMediaImplGStreamer::seek(double time)
894// virtual 895// virtual
895bool LLMediaImplGStreamer::setVolume(float volume) 896bool LLMediaImplGStreamer::setVolume(float volume)
896{ 897{
897 // XXX hack to make volume volume changes less othen 898 // we try to only update volume as conservatively as
898 // bug in gstreamer 0.10.21 899 // possible, as many gst-plugins-base versions up to at least
899 if(mVolume == volume) 900 // November 2008 have critical race-conditions in setting volume - sigh
900 return true; 901 if (mVolume == volume)
902 return true; // nothing to do, everything's fine
901 903
902 LL_DEBUGS("MediaImpl") << "setVolume(" << volume << ") : " << getpid() << LL_ENDL;
903 mVolume = volume; 904 mVolume = volume;
904 if (mPlaybin) 905 if (mPlaybin)
905 { 906 {
906 g_object_set(mPlaybin, "volume", mVolume, NULL); 907 g_object_set(mPlaybin, "volume", mVolume, NULL);
907 return true; 908 return true;
908 } 909 }
910
909 return false; 911 return false;
910} 912}
911 913