fix(Orbis): stop asserting when voicechat fails

This commit is contained in:
str1k3r
2026-07-22 17:36:58 -04:00
parent f992d40795
commit 4099ed477d
2 changed files with 27 additions and 15 deletions
@@ -35,20 +35,29 @@ int g_loadedPCMVoiceDataSizes[4];
int g_loadedPCMVoiceDataPos[4];
char* g_loadedPCMVoiceData[4];
static void CreatePort(uint32_t *portId, const SceVoicePortParam *pArg)
{
C4JThread::PushAffinityAllCores(); // PS4 only
int err = sceVoiceCreatePort( portId, pArg );
assert(err == SCE_OK);
assert(*portId != VOICE_INVALID_PORT_ID);
C4JThread::PopAffinity(); // PS4 only
static bool CreatePort(uint32_t *portId, const SceVoicePortParam *pArg)
{
C4JThread::PushAffinityAllCores();
*portId = SCE_VOICE_INVALID_PORT_ID;
int err = sceVoiceCreatePort(portId, pArg);
//assert(err == SCE_OK);
//assert(*portId != VOICE_INVALID_PORT_ID);
C4JThread::PopAffinity();
if (err != SCE_OK || *portId == SCE_VOICE_INVALID_PORT_ID)
{
return false;
}
return true;
}
static void DeletePort(uint32_t& port)
{
int32_t result;
if (port != VOICE_INVALID_PORT_ID)
if (port != SCE_VOICE_INVALID_PORT_ID)
{
result = sceVoiceDeletePort( port );
if (result != SCE_OK)
@@ -56,7 +65,7 @@ static void DeletePort(uint32_t& port)
app.DebugPrintf("sceVoiceDeletePort failed %0x\n", result);
assert(0);
}
port = VOICE_INVALID_PORT_ID;
port = SCE_VOICE_INVALID_PORT_ID;
}
}
@@ -122,7 +131,12 @@ void SonyVoiceChat_Orbis::init()
portArgs.volume = 1.0f;
portArgs.voice.bitrate = VOICE_ENCODED_FORMAT;
#endif
CreatePort( &m_voiceOutPort, &portArgs );
//CreatePort( &m_voiceOutPort, &portArgs );
if (!CreatePort(&m_voiceOutPort, &portArgs))
{
return;
}
start();
m_bInitialised = true;