summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/linux_tools/register_secondlifeprotocol.sh22
-rw-r--r--indra/newview/llviewermedia_streamingaudio.cpp31
2 files changed, 30 insertions, 23 deletions
diff --git a/indra/newview/linux_tools/register_secondlifeprotocol.sh b/indra/newview/linux_tools/register_secondlifeprotocol.sh
index c7b4d55461..16e73cb854 100755
--- a/indra/newview/linux_tools/register_secondlifeprotocol.sh
+++ b/indra/newview/linux_tools/register_secondlifeprotocol.sh
@@ -22,13 +22,12 @@ else
fi
# Register handler for KDE-aware apps
-if [ -z "$KDEHOME" ]; then
- KDEHOME=~/.kde
-fi
-LLKDEPROTDIR=${KDEHOME}/share/services
-if [ -d "$LLKDEPROTDIR" ]; then
- LLKDEPROTFILE=${LLKDEPROTDIR}/secondlife.protocol
- cat > ${LLKDEPROTFILE} <<EOF || echo Warning: Did not register secondlife:// handler with KDE: Could not write ${LLKDEPROTFILE}
+for LLKDECONFIG in kde-config kde4-config; do
+ if [ `which $LLKDECONFIG` ]; then
+ LLKDEPROTODIR=`$LLKDECONFIG --path services | cut -d ':' -f 1`
+ if [ -d "$LLKDEPROTODIR" ]; then
+ LLKDEPROTOFILE=${LLKDEPROTODIR}/secondlife.protocol
+ cat > ${LLKDEPROTOFILE} <<EOF || echo Warning: Did not register secondlife:// handler with KDE: Could not write ${LLKDEPROTOFILE}
[Protocol]
exec=${HANDLER} '%u'
protocol=secondlife
@@ -41,6 +40,9 @@ writing=false
makedir=false
deleting=false
EOF
-else
- echo Warning: Did not register secondlife:// handler with KDE: Directory $LLKDEPROTDIR does not exist.
-fi
+ else
+ echo Warning: Did not register secondlife:// handler with KDE: Directory $LLKDEPROTODIR does not exist.
+ fi
+ fi
+done
+
diff --git a/indra/newview/llviewermedia_streamingaudio.cpp b/indra/newview/llviewermedia_streamingaudio.cpp
index 90cfb85821..e9293ac5a4 100644
--- a/indra/newview/llviewermedia_streamingaudio.cpp
+++ b/indra/newview/llviewermedia_streamingaudio.cpp
@@ -1,7 +1,7 @@
/**
* @file llviewermedia_streamingaudio.h
* @author Tofu Linden, Sam Kolb
- * @brief LLStreamingAudio_MediaPlugins implementation - an implementation of the streaming audio interface which is implemented as a client of the media plugins API.
+ * @brief LLStreamingAudio_MediaPlugins implementation - an implementation of the streaming audio interface which is implemented as a client of the media plugin API.
*
* $LicenseInfo:firstyear=2009&license=viewergpl$
*
@@ -33,6 +33,7 @@
#include "llviewerprecompiledheaders.h"
#include "linden_common.h"
#include "llpluginclassmedia.h"
+#include "llpluginclassmediaowner.h"
#include "llviewermedia.h"
#include "llviewermedia_streamingaudio.h"
@@ -61,18 +62,18 @@ void LLStreamingAudio_MediaPlugins::start(const std::string& url)
if (!mMediaPlugin) // lazy-init the underlying media plugin
{
mMediaPlugin = initializeMedia("audio/mpeg"); // assumes that whatever media implementation supports mp3 also supports vorbis.
- llinfos << "mMediaPlugin is now " << mMediaPlugin << llendl;
+ llinfos << "steaming audio mMediaPlugin is now " << mMediaPlugin << llendl;
}
if(!mMediaPlugin)
return;
-
+
if (!url.empty()) {
llinfos << "Starting internet stream: " << url << llendl;
mURL = url;
mMediaPlugin->loadURI ( url );
mMediaPlugin->start();
- llinfos << "Playing....." << llendl;
+ llinfos << "Playing stream..." << llendl;
} else {
llinfos << "setting stream to NULL"<< llendl;
mURL.clear();
@@ -82,6 +83,7 @@ void LLStreamingAudio_MediaPlugins::start(const std::string& url)
void LLStreamingAudio_MediaPlugins::stop()
{
+ llinfos << "Stopping internet stream." << llendl;
if(mMediaPlugin)
{
mMediaPlugin->stop();
@@ -97,10 +99,12 @@ void LLStreamingAudio_MediaPlugins::pause(int pause)
if(pause)
{
+ llinfos << "Pausing internet stream." << llendl;
mMediaPlugin->pause();
}
else
{
+ llinfos << "Unpausing internet stream." << llendl;
mMediaPlugin->start();
}
}
@@ -114,20 +118,21 @@ void LLStreamingAudio_MediaPlugins::update()
int LLStreamingAudio_MediaPlugins::isPlaying()
{
if (!mMediaPlugin)
- return 0;
+ return 0; // stopped
- // *TODO: can probably do better than this
- if (mMediaPlugin->isPluginRunning())
- {
- return 1; // Active and playing
- }
+ LLPluginClassMediaOwner::EMediaStatus status =
+ mMediaPlugin->getStatus();
- if (mMediaPlugin->isPluginExited())
+ switch (status)
{
+ case LLPluginClassMediaOwner::MEDIA_LOADING: // but not MEDIA_LOADED
+ case LLPluginClassMediaOwner::MEDIA_PLAYING:
+ return 1; // Active and playing
+ case LLPluginClassMediaOwner::MEDIA_PAUSED:
+ return 2; // paused
+ default:
return 0; // stopped
}
-
- return 2; // paused
}
void LLStreamingAudio_MediaPlugins::setGain(F32 vol)