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
39b7671d
Commit
39b7671d
authored
12 years ago
by
simon@Simon-PC.lindenlab.com
Browse files
Options
Downloads
Patches
Plain Diff
MAINT-862 and ER-1781 : Sounds not playing the first time. Reviewed by Kelly.
parent
a519e34f
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
indra/llaudio/llaudiodecodemgr.cpp
+16
-6
16 additions, 6 deletions
indra/llaudio/llaudiodecodemgr.cpp
indra/llaudio/llaudioengine.cpp
+14
-8
14 additions, 8 deletions
indra/llaudio/llaudioengine.cpp
indra/llaudio/llaudioengine.h
+6
-3
6 additions, 3 deletions
indra/llaudio/llaudioengine.h
with
36 additions
and
17 deletions
indra/llaudio/llaudiodecodemgr.cpp
+
16
−
6
View file @
39b7671d
...
...
@@ -571,7 +571,8 @@ void LLAudioDecodeMgr::Impl::processQueue(const F32 num_secs)
llwarns
<<
mCurrentDecodep
->
getUUID
()
<<
" has invalid vorbis data, aborting decode"
<<
llendl
;
mCurrentDecodep
->
flushBadFile
();
LLAudioData
*
adp
=
gAudiop
->
getAudioData
(
mCurrentDecodep
->
getUUID
());
adp
->
setHasValidData
(
FALSE
);
adp
->
setHasValidData
(
false
);
adp
->
setHasCompletedDecode
(
true
);
mCurrentDecodep
=
NULL
;
done
=
TRUE
;
}
...
...
@@ -586,11 +587,16 @@ void LLAudioDecodeMgr::Impl::processQueue(const F32 num_secs)
if
(
mCurrentDecodep
->
finishDecode
())
{
// We finished!
if
(
mCurrentDecodep
->
isValid
()
&&
mCurrentDecodep
->
isDone
())
LLAudioData
*
adp
=
gAudiop
->
getAudioData
(
mCurrentDecodep
->
getUUID
());
if
(
!
adp
)
{
LLAudioData
*
adp
=
gAudiop
->
getAudioData
(
mCurrentDecodep
->
getUUID
());
adp
->
setHasDecodedData
(
TRUE
);
adp
->
setHasValidData
(
TRUE
);
llwarns
<<
"Missing LLAudioData for decode of "
<<
mCurrentDecodep
->
getUUID
()
<<
llendl
;
}
else
if
(
mCurrentDecodep
->
isValid
()
&&
mCurrentDecodep
->
isDone
())
{
adp
->
setHasCompletedDecode
(
true
);
adp
->
setHasDecodedData
(
true
);
adp
->
setHasValidData
(
true
);
// At this point, we could see if anyone needs this sound immediately, but
// I'm not sure that there's a reason to - we need to poll all of the playing
...
...
@@ -599,7 +605,8 @@ void LLAudioDecodeMgr::Impl::processQueue(const F32 num_secs)
}
else
{
llinfos
<<
"Vorbis decode failed!!!"
<<
llendl
;
adp
->
setHasCompletedDecode
(
true
);
llinfos
<<
"Vorbis decode failed for "
<<
mCurrentDecodep
->
getUUID
()
<<
llendl
;
}
mCurrentDecodep
=
NULL
;
}
...
...
@@ -667,16 +674,19 @@ BOOL LLAudioDecodeMgr::addDecodeRequest(const LLUUID &uuid)
if
(
gAudiop
->
hasDecodedFile
(
uuid
))
{
// Already have a decoded version, don't need to decode it.
//llinfos << "addDecodeRequest for " << uuid << " has decoded file already" << llendl;
return
TRUE
;
}
if
(
gAssetStorage
->
hasLocalAsset
(
uuid
,
LLAssetType
::
AT_SOUND
))
{
// Just put it on the decode queue.
//llinfos << "addDecodeRequest for " << uuid << " has local asset file already" << llendl;
mImpl
->
mDecodeQueue
.
push
(
uuid
);
return
TRUE
;
}
//llinfos << "addDecodeRequest for " << uuid << " no file available" << llendl;
return
FALSE
;
}
...
...
This diff is collapsed.
Click to expand it.
indra/llaudio/llaudioengine.cpp
+
14
−
8
View file @
39b7671d
...
...
@@ -1221,10 +1221,11 @@ void LLAudioEngine::assetCallback(LLVFS *vfs, const LLUUID &uuid, LLAssetType::E
// Need to mark data as bad to avoid constant rerequests.
LLAudioData
*
adp
=
gAudiop
->
getAudioData
(
uuid
);
if
(
adp
)
{
{
// Make sure everything is cleared
adp
->
setHasValidData
(
false
);
adp
->
setHasLocalData
(
false
);
adp
->
setHasDecodedData
(
false
);
adp
->
setHasCompletedDecode
(
true
);
}
}
else
...
...
@@ -1237,6 +1238,7 @@ void LLAudioEngine::assetCallback(LLVFS *vfs, const LLUUID &uuid, LLAssetType::E
}
else
{
// llinfos << "Got asset callback with good audio data for " << uuid << ", making decode request" << llendl;
adp
->
setHasValidData
(
true
);
adp
->
setHasLocalData
(
true
);
gAudioDecodeMgrp
->
addDecodeRequest
(
uuid
);
...
...
@@ -1304,16 +1306,18 @@ void LLAudioSource::update()
if
(
!
getCurrentBuffer
())
{
if
(
getCurrentData
())
LLAudioData
*
adp
=
getCurrentData
();
if
(
adp
)
{
// Hack - try and load the sound. Will do this as a callback
// on decode later.
if
(
getCurrentData
()
->
load
()
&&
getCurrentData
()
->
getBuffer
())
if
(
adp
->
load
()
&&
adp
->
getBuffer
())
{
play
(
getCurrentData
()
->
getID
());
play
(
adp
->
getID
());
}
else
else
if
(
adp
->
hasCompletedDecode
())
// Only mark corrupted after decode is done
{
llwarns
<<
"Marking LLAudioSource corrupted for "
<<
adp
->
getID
()
<<
llendl
;
mCorrupted
=
true
;
}
}
...
...
@@ -1731,6 +1735,7 @@ LLAudioData::LLAudioData(const LLUUID &uuid) :
mBufferp
(
NULL
),
mHasLocalData
(
false
),
mHasDecodedData
(
false
),
mHasCompletedDecode
(
false
),
mHasValidData
(
true
)
{
if
(
uuid
.
isNull
())
...
...
@@ -1742,12 +1747,13 @@ LLAudioData::LLAudioData(const LLUUID &uuid) :
if
(
gAudiop
&&
gAudiop
->
hasDecodedFile
(
uuid
))
{
// Already have a decoded version, don't need to decode it.
mHasLocalData
=
true
;
mHasDecodedData
=
true
;
setHasLocalData
(
true
);
setHasDecodedData
(
true
);
setHasCompletedDecode
(
true
);
}
else
if
(
gAssetStorage
&&
gAssetStorage
->
hasLocalAsset
(
uuid
,
LLAssetType
::
AT_SOUND
))
{
m
HasLocalData
=
true
;
set
HasLocalData
(
true
)
;
}
}
...
...
This diff is collapsed.
Click to expand it.
indra/llaudio/llaudioengine.h
+
6
−
3
View file @
39b7671d
...
...
@@ -372,10 +372,12 @@ class LLAudioData
bool
hasLocalData
()
const
{
return
mHasLocalData
;
}
bool
hasDecodedData
()
const
{
return
mHasDecodedData
;
}
bool
hasCompletedDecode
()
const
{
return
mHasCompletedDecode
;
}
bool
hasValidData
()
const
{
return
mHasValidData
;
}
void
setHasLocalData
(
const
bool
hld
)
{
mHasLocalData
=
hld
;
}
void
setHasDecodedData
(
const
bool
hdd
)
{
mHasDecodedData
=
hdd
;
}
void
setHasCompletedDecode
(
const
bool
hcd
)
{
mHasCompletedDecode
=
hcd
;
}
void
setHasValidData
(
const
bool
hvd
)
{
mHasValidData
=
hvd
;
}
friend
class
LLAudioEngine
;
// Severe laziness, bad.
...
...
@@ -383,9 +385,10 @@ class LLAudioData
protected
:
LLUUID
mID
;
LLAudioBuffer
*
mBufferp
;
// If this data is being used by the audio system, a pointer to the buffer will be set here.
bool
mHasLocalData
;
bool
mHasDecodedData
;
bool
mHasValidData
;
bool
mHasLocalData
;
// Set true if the sound asset file is available locally
bool
mHasDecodedData
;
// Set true if the sound file has been decoded
bool
mHasCompletedDecode
;
// Set true when the sound is decoded
bool
mHasValidData
;
// Set false if decoding failed, meaning the sound asset is bad
};
...
...
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