diff options
author | McCabe Maxsted | 2009-03-10 13:37:22 -0700 |
---|---|---|
committer | McCabe Maxsted | 2009-03-10 13:37:22 -0700 |
commit | 8bd62baddd2b1c4038193bd80d76ddd27dc1ba35 (patch) | |
tree | f8cabb20db91157e2a32404a4e93fe20fa6ac18b /linden/indra/llaudio/audioengine.cpp | |
parent | Use std::string for nametags, removed bizarre name stacking option (diff) | |
download | meta-impy-8bd62baddd2b1c4038193bd80d76ddd27dc1ba35.zip meta-impy-8bd62baddd2b1c4038193bd80d76ddd27dc1ba35.tar.gz meta-impy-8bd62baddd2b1c4038193bd80d76ddd27dc1ba35.tar.bz2 meta-impy-8bd62baddd2b1c4038193bd80d76ddd27dc1ba35.tar.xz |
Changed startinternetstream() a bit to be clearer
Diffstat (limited to '')
-rw-r--r-- | linden/indra/llaudio/audioengine.cpp | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/linden/indra/llaudio/audioengine.cpp b/linden/indra/llaudio/audioengine.cpp index 75901e8..438aefc 100644 --- a/linden/indra/llaudio/audioengine.cpp +++ b/linden/indra/llaudio/audioengine.cpp | |||
@@ -191,39 +191,43 @@ void LLAudioEngine::startInternetStream(const std::string& url) | |||
191 | if (mgr) | 191 | if (mgr) |
192 | { | 192 | { |
193 | mInternetStreamMedia = mgr->createSourceFromMimeType(LLURI(url).scheme(), "audio/mpeg"); // assumes that whatever media implementation supports mp3 also supports vorbis. | 193 | mInternetStreamMedia = mgr->createSourceFromMimeType(LLURI(url).scheme(), "audio/mpeg"); // assumes that whatever media implementation supports mp3 also supports vorbis. |
194 | //LL_INFOS("AudioEngine") << "mInternetStreamMedia is now " << mInternetStreamMedia << llendl; | 194 | LL_INFOS("AudioEngine") << "mInternetStreamMedia is now " << mInternetStreamMedia << llendl; |
195 | } | 195 | } |
196 | } | 196 | } |
197 | 197 | ||
198 | if(!mInternetStreamMedia) | 198 | if(!mInternetStreamMedia) |
199 | { | ||
199 | return; | 200 | return; |
200 | 201 | } | |
201 | // Check for a dead stream, just in case | 202 | // Check for a dead stream from gstreamer, just in case |
202 | if(getStatus() == LLMediaBase::STATUS_DEAD) | 203 | else if(getStatus() == LLMediaBase::STATUS_DEAD) |
203 | { | 204 | { |
204 | LL_INFOS("AudioEngine") << "don't play dead stream urls"<< llendl; | 205 | LL_INFOS("AudioEngine") << "don't play dead stream urls"<< llendl; |
205 | mInternetStreamURL.clear(); | 206 | mInternetStreamURL.clear(); |
206 | mInternetStreamMedia->addCommand(LLMediaBase::COMMAND_STOP); | 207 | mInternetStreamMedia->addCommand(LLMediaBase::COMMAND_STOP); |
207 | mInternetStreamMedia->updateMedia(); | 208 | mInternetStreamMedia->updateMedia(); |
208 | stopInternetStream(); | 209 | stopInternetStream(); |
209 | return; | ||
210 | } | 210 | } |
211 | 211 | else if (url.empty()) | |
212 | if (!url.empty()) | ||
213 | { | 212 | { |
214 | LL_INFOS("AudioEngine") << "Starting internet stream: " << url << llendl; | 213 | LL_INFOS("AudioEngine") << "url is emptly. Setting stream to NULL"<< llendl; |
215 | mInternetStreamURL = url; | 214 | mInternetStreamURL.clear(); |
216 | mInternetStreamMedia->navigateTo ( url ); | 215 | mInternetStreamMedia->addCommand(LLMediaBase::COMMAND_STOP); |
217 | LL_INFOS("AudioEngine") << "Playing....." << llendl; | ||
218 | mInternetStreamMedia->addCommand(LLMediaBase::COMMAND_START); | ||
219 | mInternetStreamMedia->updateMedia(); | 216 | mInternetStreamMedia->updateMedia(); |
220 | } | 217 | } |
218 | // Stream appears to be good, attempting to play | ||
221 | else | 219 | else |
222 | { | 220 | { |
223 | LL_INFOS("AudioEngine") << "setting stream to NULL"<< llendl; | 221 | // stop any other stream first |
224 | mInternetStreamURL.clear(); | 222 | stopInternetStream(); |
225 | mInternetStreamMedia->addCommand(LLMediaBase::COMMAND_STOP); | 223 | |
224 | LL_INFOS("AudioEngine") << "Starting internet stream: " << url << llendl; | ||
225 | mInternetStreamURL = url; | ||
226 | mInternetStreamMedia->navigateTo(url); | ||
227 | //LL_INFOS("AudioEngine") << "Playing....." << llendl; | ||
228 | mInternetStreamMedia->addCommand(LLMediaBase::COMMAND_START); | ||
226 | mInternetStreamMedia->updateMedia(); | 229 | mInternetStreamMedia->updateMedia(); |
230 | mStatus = LLMediaBase::STATUS_STARTED; | ||
227 | } | 231 | } |
228 | } | 232 | } |
229 | 233 | ||
@@ -231,7 +235,8 @@ void LLAudioEngine::startInternetStream(const std::string& url) | |||
231 | void LLAudioEngine::stopInternetStream() | 235 | void LLAudioEngine::stopInternetStream() |
232 | { | 236 | { |
233 | LL_INFOS("AudioEngine") << "entered stopInternetStream()" << llendl; | 237 | LL_INFOS("AudioEngine") << "entered stopInternetStream()" << llendl; |
234 | 238 | mInternetStreamURL.clear(); | |
239 | |||
235 | if(mInternetStreamMedia) | 240 | if(mInternetStreamMedia) |
236 | { | 241 | { |
237 | if(!mInternetStreamMedia->addCommand(LLMediaBase::COMMAND_STOP)) | 242 | if(!mInternetStreamMedia->addCommand(LLMediaBase::COMMAND_STOP)) |
@@ -240,8 +245,6 @@ void LLAudioEngine::stopInternetStream() | |||
240 | } | 245 | } |
241 | mInternetStreamMedia->updateMedia(); | 246 | mInternetStreamMedia->updateMedia(); |
242 | } | 247 | } |
243 | |||
244 | mInternetStreamURL.clear(); | ||
245 | } | 248 | } |
246 | 249 | ||
247 | // virtual | 250 | // virtual |