fix(Orbis): stop asserting when voicechat fails
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -8,8 +8,6 @@
|
||||
|
||||
static const int sc_maxVoiceDataSize = 2048;
|
||||
|
||||
#define VOICE_INVALID_PORT_ID 0xff // str1k3r - use of SCE_VOICE_INVALID_PORT_ID causes a crash when loading / making worlds.
|
||||
|
||||
class VoicePacket
|
||||
{
|
||||
static const int MAX_LOCAL_PLAYER_COUNT = 4;
|
||||
@@ -89,8 +87,8 @@ public:
|
||||
public:
|
||||
SQRLocalVoiceDevice()
|
||||
: m_localUserID(SCE_USER_SERVICE_USER_ID_INVALID)
|
||||
, m_headsetPort(VOICE_INVALID_PORT_ID)
|
||||
, m_microphonePort(VOICE_INVALID_PORT_ID)
|
||||
, m_headsetPort(SCE_VOICE_INVALID_PORT_ID)
|
||||
, m_microphonePort(SCE_VOICE_INVALID_PORT_ID)
|
||||
{
|
||||
for(int i=0;i<4;i++)
|
||||
m_localConnections[i] = 0;
|
||||
|
||||
Reference in New Issue
Block a user