fix(orbis): voicechat crash

This commit is contained in:
str1k3r
2026-07-17 13:45:53 -04:00
parent 9171922767
commit 0a38bb51bc
@@ -26,6 +26,8 @@ static const int sc_thresholdValue = 100;
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_MIC_DATA
@@ -41,14 +43,14 @@ static void CreatePort(uint32_t *portId, const SceVoicePortParam *pArg)
int err = sceVoiceCreatePort( portId, pArg );
assert(err == SCE_OK);
assert(*portId != SCE_VOICE_INVALID_PORT_ID);
assert(*portId != sce_voice_port);
C4JThread::PopAffinity(); // PS4 only
}
static void DeletePort(uint32_t& port)
{
int32_t result;
if (port != SCE_VOICE_INVALID_PORT_ID)
if (port != sce_voice_port)
{
result = sceVoiceDeletePort( port );
if (result != SCE_OK)
@@ -56,7 +58,7 @@ static void DeletePort(uint32_t& port)
app.DebugPrintf("sceVoiceDeletePort failed %0x\n", result);
assert(0);
}
port = SCE_VOICE_INVALID_PORT_ID;
port = sce_voice_port;
}
}