fix(orbis): better fix for orbis voicechat crash
This most likely can be fixed a more proper way but this is what works and is better then the previous method
This commit is contained in:
@@ -26,8 +26,6 @@ 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
|
||||
|
||||
@@ -43,14 +41,14 @@ static void CreatePort(uint32_t *portId, const SceVoicePortParam *pArg)
|
||||
|
||||
int err = sceVoiceCreatePort( portId, pArg );
|
||||
assert(err == SCE_OK);
|
||||
assert(*portId != sce_voice_port);
|
||||
assert(*portId != VOICE_INVALID_PORT_ID);
|
||||
C4JThread::PopAffinity(); // PS4 only
|
||||
}
|
||||
|
||||
static void DeletePort(uint32_t& port)
|
||||
{
|
||||
int32_t result;
|
||||
if (port != sce_voice_port)
|
||||
if (port != VOICE_INVALID_PORT_ID)
|
||||
{
|
||||
result = sceVoiceDeletePort( port );
|
||||
if (result != SCE_OK)
|
||||
@@ -58,7 +56,7 @@ static void DeletePort(uint32_t& port)
|
||||
app.DebugPrintf("sceVoiceDeletePort failed %0x\n", result);
|
||||
assert(0);
|
||||
}
|
||||
port = sce_voice_port;
|
||||
port = VOICE_INVALID_PORT_ID;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
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
|
||||
{
|
||||
@@ -87,9 +88,9 @@ public:
|
||||
|
||||
public:
|
||||
SQRLocalVoiceDevice()
|
||||
: m_headsetPort(SCE_VOICE_INVALID_PORT_ID)
|
||||
, m_microphonePort(SCE_VOICE_INVALID_PORT_ID)
|
||||
, m_localUserID(SCE_USER_SERVICE_USER_ID_INVALID)
|
||||
: m_headsetPort(VOICE_INVALID_PORT_ID)
|
||||
, m_microphonePort(VOICE_INVALID_PORT_ID)
|
||||
{
|
||||
for(int i=0;i<4;i++)
|
||||
m_localConnections[i] = 0;
|
||||
|
||||
Reference in New Issue
Block a user