fix(orbis): voicechat crash
This commit is contained in:
1 parent
9171922767
commit
0a38bb51bc
1 file changed
+5
-3
@@ -26,6 +26,8 @@ static const int sc_thresholdValue = 100;
|
|||||||
|
|
||||||
static const bool sc_verbose = false;
|
static const bool sc_verbose = false;
|
||||||
|
|
||||||
|
static const int sce_voice_port = 25566; // str1k3r - use of SCE_VOICE_INVALID_PORT_ID causes a crash when loading / making worlds.
|
||||||
|
|
||||||
// #define _USE_PCM_AUDIO_
|
// #define _USE_PCM_AUDIO_
|
||||||
//#define USE_PCM_MIC_DATA
|
//#define USE_PCM_MIC_DATA
|
||||||
|
|
||||||
@@ -41,14 +43,14 @@ static void CreatePort(uint32_t *portId, const SceVoicePortParam *pArg)
|
|||||||
|
|
||||||
int err = sceVoiceCreatePort( portId, pArg );
|
int err = sceVoiceCreatePort( portId, pArg );
|
||||||
assert(err == SCE_OK);
|
assert(err == SCE_OK);
|
||||||
assert(*portId != SCE_VOICE_INVALID_PORT_ID);
|
assert(*portId != sce_voice_port);
|
||||||
C4JThread::PopAffinity(); // PS4 only
|
C4JThread::PopAffinity(); // PS4 only
|
||||||
}
|
}
|
||||||
|
|
||||||
static void DeletePort(uint32_t& port)
|
static void DeletePort(uint32_t& port)
|
||||||
{
|
{
|
||||||
int32_t result;
|
int32_t result;
|
||||||
if (port != SCE_VOICE_INVALID_PORT_ID)
|
if (port != sce_voice_port)
|
||||||
{
|
{
|
||||||
result = sceVoiceDeletePort( port );
|
result = sceVoiceDeletePort( port );
|
||||||
if (result != SCE_OK)
|
if (result != SCE_OK)
|
||||||
@@ -56,7 +58,7 @@ static void DeletePort(uint32_t& port)
|
|||||||
app.DebugPrintf("sceVoiceDeletePort failed %0x\n", result);
|
app.DebugPrintf("sceVoiceDeletePort failed %0x\n", result);
|
||||||
assert(0);
|
assert(0);
|
||||||
}
|
}
|
||||||
port = SCE_VOICE_INVALID_PORT_ID;
|
port = sce_voice_port;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user