修复VoiceCallback的空指针BUG
This commit is contained in:
parent
5c0fc8fc1e
commit
950f502b19
|
|
@ -21,7 +21,11 @@ void e2d::VoiceCallback::OnLoopEnd(void * pBufferContext)
|
||||||
|
|
||||||
void e2d::VoiceCallback::OnStreamEnd()
|
void e2d::VoiceCallback::OnStreamEnd()
|
||||||
{
|
{
|
||||||
_music->_playing = false;
|
if (_music)
|
||||||
|
{
|
||||||
|
_music->_playing = false;
|
||||||
|
}
|
||||||
|
|
||||||
if (_streamEndFunc)
|
if (_streamEndFunc)
|
||||||
{
|
{
|
||||||
_streamEndFunc();
|
_streamEndFunc();
|
||||||
|
|
@ -34,12 +38,19 @@ void e2d::VoiceCallback::OnBufferEnd(void * pBufferContext)
|
||||||
{
|
{
|
||||||
_loopEndFunc();
|
_loopEndFunc();
|
||||||
}
|
}
|
||||||
e2d::GC::release(_music);
|
|
||||||
|
if (_music)
|
||||||
|
{
|
||||||
|
_music->release();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void e2d::VoiceCallback::OnBufferStart(void * pBufferContext)
|
void e2d::VoiceCallback::OnBufferStart(void * pBufferContext)
|
||||||
{
|
{
|
||||||
e2d::GC::retain(_music);
|
if (_music)
|
||||||
|
{
|
||||||
|
_music->retain();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void e2d::VoiceCallback::OnVoiceProcessingPassEnd()
|
void e2d::VoiceCallback::OnVoiceProcessingPassEnd()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue