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
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Operate
Terraform modules
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
Alchemy Viewer
Alchemy Viewer
Commits
478c1e47
Commit
478c1e47
authored
3 years ago
by
Andrey Kleshchev
Browse files
Options
Downloads
Patches
Plain Diff
SL-16902 Fmod better logging
parent
9f102ad7
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!83
Merge Linden 6.6.7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
indra/llaudio/llstreamingaudio_fmodstudio.cpp
+26
-5
26 additions, 5 deletions
indra/llaudio/llstreamingaudio_fmodstudio.cpp
with
26 additions
and
5 deletions
indra/llaudio/llstreamingaudio_fmodstudio.cpp
+
26
−
5
View file @
478c1e47
...
@@ -70,7 +70,11 @@ mRetryCount(0)
...
@@ -70,7 +70,11 @@ mRetryCount(0)
// Must be larger than the usual Second Life frame stutter time.
// Must be larger than the usual Second Life frame stutter time.
const
U32
buffer_seconds
=
10
;
//sec
const
U32
buffer_seconds
=
10
;
//sec
const
U32
estimated_bitrate
=
128
;
//kbit/sec
const
U32
estimated_bitrate
=
128
;
//kbit/sec
mSystem
->
setStreamBufferSize
(
estimated_bitrate
*
buffer_seconds
*
128
/*bytes/kbit*/
,
FMOD_TIMEUNIT_RAWBYTES
);
FMOD_RESULT
result
=
mSystem
->
setStreamBufferSize
(
estimated_bitrate
*
buffer_seconds
*
128
/*bytes/kbit*/
,
FMOD_TIMEUNIT_RAWBYTES
);
if
(
result
!=
FMOD_OK
)
{
LL_WARNS
(
"FMOD"
)
<<
"setStreamBufferSize error: "
<<
FMOD_ErrorString
(
result
)
<<
LL_ENDL
;
}
// Here's where we set the size of the network buffer and some buffering
// 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
// parameters. In this case we want a network buffer of 16k, we want it
...
@@ -404,7 +408,11 @@ FMOD::Channel *LLAudioStreamManagerFMODSTUDIO::startStream()
...
@@ -404,7 +408,11 @@ FMOD::Channel *LLAudioStreamManagerFMODSTUDIO::startStream()
if
(
mStreamChannel
)
if
(
mStreamChannel
)
return
mStreamChannel
;
//Already have a channel for this stream.
return
mStreamChannel
;
//Already have a channel for this stream.
mSystem
->
playSound
(
mInternetStream
,
NULL
,
true
,
&
mStreamChannel
);
FMOD_RESULT
result
=
mSystem
->
playSound
(
mInternetStream
,
NULL
,
true
,
&
mStreamChannel
);
if
(
result
!=
FMOD_OK
)
{
LL_WARNS
(
"FMOD"
)
<<
FMOD_ErrorString
(
result
)
<<
LL_ENDL
;
}
return
mStreamChannel
;
return
mStreamChannel
;
}
}
...
@@ -445,16 +453,29 @@ bool LLAudioStreamManagerFMODSTUDIO::stopStream()
...
@@ -445,16 +453,29 @@ bool LLAudioStreamManagerFMODSTUDIO::stopStream()
FMOD_OPENSTATE
LLAudioStreamManagerFMODSTUDIO
::
getOpenState
(
unsigned
int
*
percentbuffered
,
bool
*
starving
,
bool
*
diskbusy
)
FMOD_OPENSTATE
LLAudioStreamManagerFMODSTUDIO
::
getOpenState
(
unsigned
int
*
percentbuffered
,
bool
*
starving
,
bool
*
diskbusy
)
{
{
FMOD_OPENSTATE
state
;
FMOD_OPENSTATE
state
;
mInternetStream
->
getOpenState
(
&
state
,
percentbuffered
,
starving
,
diskbusy
);
FMOD_RESULT
result
=
mInternetStream
->
getOpenState
(
&
state
,
percentbuffered
,
starving
,
diskbusy
);
if
(
result
!=
FMOD_OK
)
{
LL_WARNS
(
"FMOD"
)
<<
FMOD_ErrorString
(
result
)
<<
LL_ENDL
;
}
return
state
;
return
state
;
}
}
void
LLStreamingAudio_FMODSTUDIO
::
setBufferSizes
(
U32
streambuffertime
,
U32
decodebuffertime
)
void
LLStreamingAudio_FMODSTUDIO
::
setBufferSizes
(
U32
streambuffertime
,
U32
decodebuffertime
)
{
{
mSystem
->
setStreamBufferSize
(
streambuffertime
/
1000
*
128
*
128
,
FMOD_TIMEUNIT_RAWBYTES
);
FMOD_RESULT
result
=
mSystem
->
setStreamBufferSize
(
streambuffertime
/
1000
*
128
*
128
,
FMOD_TIMEUNIT_RAWBYTES
);
if
(
result
!=
FMOD_OK
)
{
LL_WARNS
(
"FMOD"
)
<<
"setStreamBufferSize error: "
<<
FMOD_ErrorString
(
result
)
<<
LL_ENDL
;
return
;
}
FMOD_ADVANCEDSETTINGS
settings
;
FMOD_ADVANCEDSETTINGS
settings
;
memset
(
&
settings
,
0
,
sizeof
(
settings
));
memset
(
&
settings
,
0
,
sizeof
(
settings
));
settings
.
cbSize
=
sizeof
(
settings
);
settings
.
cbSize
=
sizeof
(
settings
);
settings
.
defaultDecodeBufferSize
=
decodebuffertime
;
//ms
settings
.
defaultDecodeBufferSize
=
decodebuffertime
;
//ms
mSystem
->
setAdvancedSettings
(
&
settings
);
result
=
mSystem
->
setAdvancedSettings
(
&
settings
);
if
(
result
!=
FMOD_OK
)
{
LL_WARNS
(
"FMOD"
)
<<
"setAdvancedSettings error: "
<<
FMOD_ErrorString
(
result
)
<<
LL_ENDL
;
}
}
}
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