Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
Testicular Slingshot
Alchemy Viewer
Commits
83e618e4
Commit
83e618e4
authored
10 years ago
by
Drake Arconis
Browse files
Options
Downloads
Patches
Plain Diff
Minor FMOD Ex Streaming audio fixes and cleanup
parent
4dfed15d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
indra/llaudio/llstreamingaudio_fmodex.cpp
+30
-14
30 additions, 14 deletions
indra/llaudio/llstreamingaudio_fmodex.cpp
indra/llaudio/llstreamingaudio_fmodex.h
+1
-0
1 addition, 0 deletions
indra/llaudio/llstreamingaudio_fmodex.h
with
31 additions
and
14 deletions
indra/llaudio/llstreamingaudio_fmodex.cpp
+
30
−
14
View file @
83e618e4
...
...
@@ -70,14 +70,6 @@ LLStreamingAudio_FMODEX::LLStreamingAudio_FMODEX(FMOD::System *system) :
const
U32
buffer_seconds
=
10
;
//sec
const
U32
estimated_bitrate
=
128
;
//kbit/sec
mSystem
->
setStreamBufferSize
(
estimated_bitrate
*
buffer_seconds
*
128
/*bytes/kbit*/
,
FMOD_TIMEUNIT_RAWBYTES
);
// Here's where we set the size of the network buffer and some buffering
// parameters. In this case we want a network buffer of 16k, we want it
// to prebuffer 40% of that when we first connect, and we want it
// to rebuffer 80% of that whenever we encounter a buffer underrun.
// Leave the net buffer properties at the default.
//FSOUND_Stream_Net_SetBufferProperties(20000, 40, 80);
}
...
...
@@ -100,9 +92,17 @@ void LLStreamingAudio_FMODEX::start(const std::string& url)
if
(
!
url
.
empty
())
{
LL_INFOS
()
<<
"Starting internet stream: "
<<
url
<<
LL_ENDL
;
mCurrentInternetStreamp
=
new
LLAudioStreamManagerFMODEX
(
mSystem
,
url
);
mURL
=
url
;
if
(
mDeadStreams
.
empty
())
{
LL_INFOS
()
<<
"Starting internet stream: "
<<
url
<<
LL_ENDL
;
mCurrentInternetStreamp
=
new
LLAudioStreamManagerFMODEX
(
mSystem
,
url
);
mURL
=
url
;
}
else
{
LL_INFOS
()
<<
"Deferring stream load until buffer release: "
<<
url
<<
LL_ENDL
;
mPendingURL
=
url
;
}
}
else
{
...
...
@@ -131,6 +131,21 @@ void LLStreamingAudio_FMODEX::update()
}
}
if
(
!
mDeadStreams
.
empty
())
{
llassert_always
(
mCurrentInternetStreamp
==
NULL
);
return
;
}
if
(
!
mPendingURL
.
empty
())
{
llassert_always
(
mCurrentInternetStreamp
==
NULL
);
LL_INFOS
()
<<
"Starting internet stream: "
<<
mPendingURL
<<
LL_ENDL
;
mCurrentInternetStreamp
=
new
LLAudioStreamManagerFMODEX
(
mSystem
,
mPendingURL
);
mURL
=
mPendingURL
;
mPendingURL
.
clear
();
}
// Don't do anything if there are no streams playing
if
(
!
mCurrentInternetStreamp
)
{
...
...
@@ -211,6 +226,8 @@ void LLStreamingAudio_FMODEX::update()
void
LLStreamingAudio_FMODEX
::
stop
()
{
mPendingURL
.
clear
();
if
(
mFMODInternetStreamChannelp
)
{
mFMODInternetStreamChannelp
->
setPaused
(
true
);
...
...
@@ -264,7 +281,7 @@ int LLStreamingAudio_FMODEX::isPlaying()
{
return
1
;
// Active and playing
}
else
if
(
!
mURL
.
empty
())
else
if
(
!
mURL
.
empty
()
||
!
mPendingURL
.
empty
()
)
{
return
2
;
// "Paused"
}
...
...
@@ -356,9 +373,8 @@ bool LLAudioStreamManagerFMODEX::stopStream()
close
=
true
;
}
if
(
close
)
if
(
close
&&
mInternetStream
->
release
()
==
FMOD_OK
)
{
mInternetStream
->
release
();
mStreamChannel
=
NULL
;
mInternetStream
=
NULL
;
return
true
;
...
...
This diff is collapsed.
Click to expand it.
indra/llaudio/llstreamingaudio_fmodex.h
+
1
−
0
View file @
83e618e4
...
...
@@ -66,6 +66,7 @@ private:
std
::
list
<
LLAudioStreamManagerFMODEX
*>
mDeadStreams
;
std
::
string
mURL
;
std
::
string
mPendingURL
;
F32
mGain
;
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment