fix: #19 the CBuffer causing server crash

This commit is contained in:
yuanyuanxiang
2024-12-26 17:07:43 +08:00
parent 5b86910cb2
commit 0c0c24534b
12 changed files with 256 additions and 137 deletions

View File

@@ -106,12 +106,12 @@ void CAudioDlg::OnReceiveComplete(void)
CString strString;
strString.Format("Receive %d KBytes", m_nTotalRecvBytes / 1024);
SetDlgItemText(IDC_TIPS, strString);
switch (m_ContextObject->InDeCompressedBuffer.GetBuffer(0)[0])
switch (m_ContextObject->InDeCompressedBuffer.GetBYTE(0))
{
case TOKEN_AUDIO_DATA:
{
m_AudioObject.PlayBuffer(m_ContextObject->InDeCompressedBuffer.GetBuffer(1),
m_ContextObject->InDeCompressedBuffer.GetBufferLength() - 1); //<2F><><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
Buffer tmp = m_ContextObject->InDeCompressedBuffer.GetMyBuffer(1);
m_AudioObject.PlayBuffer(tmp.Buf(), tmp.length()); //<2F><><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
break;
}