Skip to content

Commit c25df52

Browse files
committed
#3564 Permit 'labeling' audio streams that play via media plugin
People were using fmod's undocumented capability to ignore everything after the url to label their streams.
1 parent c8f1890 commit c25df52

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

indra/newview/llviewermedia_streamingaudio.cpp

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,26 @@ void LLStreamingAudio_MediaPlugins::start(const std::string& url)
6060
if(!mMediaPlugin)
6161
return;
6262

63-
if (!url.empty()) {
63+
if (!url.empty())
64+
{
6465
LL_INFOS() << "Starting internet stream: " << url << LL_ENDL;
65-
mURL = url;
66-
mMediaPlugin->loadURI ( url );
66+
67+
mURL = url; // keep original url here for comparison purposes
68+
std::string snt_url = url;
69+
LLStringUtil::trim(snt_url);
70+
size_t pos = snt_url.find(' ');
71+
if (pos != std::string::npos)
72+
{
73+
// fmod permited having names after the url and people were using it.
74+
// People label their streams this way, ignore the 'label'.
75+
snt_url = snt_url.substr(0, pos);
76+
}
77+
mMediaPlugin->loadURI(snt_url);
6778
mMediaPlugin->start();
6879
LL_INFOS() << "Playing stream..." << LL_ENDL;
69-
} else {
80+
}
81+
else
82+
{
7083
LL_INFOS() << "setting stream to NULL"<< LL_ENDL;
7184
mURL.clear();
7285
mMediaPlugin->stop();

0 commit comments

Comments
 (0)