MB: SSI263: Don't try to create DS soundbuffer if DS is unavailable

This commit is contained in:
tomcw 2024-11-23 14:25:09 +00:00
parent b5544142e0
commit a6416acb87
2 changed files with 6 additions and 0 deletions

View File

@ -842,6 +842,9 @@ bool SSI263::DSInit(void)
// Create single SSI263 voice
//
if (!g_bDSAvailable)
return false;
HRESULT hr = DSGetSoundBuffer(&SSI263SingleVoice, DSBCAPS_CTRLVOLUME, m_kDSBufferByteSize, SAMPLE_RATE_SSI263, m_kNumChannels, "SSI263");
LogFileOutput("SSI263::DSInit: DSGetSoundBuffer(), hr=0x%08X\n", hr);
if (FAILED(hr))

View File

@ -184,6 +184,9 @@ HRESULT DSGetLock(LPDIRECTSOUNDBUFFER pVoice, DWORD dwOffset, DWORD dwBytes,
HRESULT DSGetSoundBuffer(VOICE* pVoice, DWORD dwFlags, DWORD dwBufferSize, DWORD nSampleRate, int nChannels, const char* pszDevName)
{
if (!g_lpDS)
return E_FAIL;
pVoice->name = pszDevName;
WAVEFORMATEX wavfmt;