Merge pull request #1575 from LukeUsher/bug-hunting

Implement CDirectSoundStream_GetInfo
This commit is contained in:
RadWolfie 2019-03-27 23:33:45 -05:00 committed by GitHub
commit 274c6fd083
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 10 deletions

View File

@ -8572,7 +8572,8 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SetScreenSpaceOffset)
LOG_FUNC_ARG(y)
LOG_FUNC_END;
EmuLog(LOG_LEVEL::WARNING, "EmuD3DDevice_SetScreenSpaceOffset ignored");
// No need to log this, it's safe to ignore.
//EmuLog(LOG_LEVEL::WARNING, "EmuD3DDevice_SetScreenSpaceOffset ignored");
}
// ******************************************************************

View File

@ -1931,14 +1931,11 @@ HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_GetInfo)
LOG_FUNC_ARG_OUT(pInfo)
LOG_FUNC_END;
// TODO: A (real) implementation?
EmuLog(LOG_LEVEL::WARNING, "EmuDirectSound_CDirectSoundStream_GetInfo is not yet supported!");
if (pInfo) {
pInfo->dwFlags = XMO_STREAMF_FIXED_SAMPLE_SIZE;
pInfo->dwInputSize = 0x40000;
pInfo->dwOutputSize = 0x40000;
pInfo->dwMaxLookahead = 0x4000;
pInfo->dwFlags = XMO_STREAMF_FIXED_SAMPLE_SIZE | XMO_STREAMF_INPUT_ASYNC;
pInfo->dwInputSize = pThis->EmuBufferDesc.lpwfxFormat->nBlockAlign;
pInfo->dwOutputSize = 0;
pInfo->dwMaxLookahead = std::max(static_cast<uint32_t>(pThis->EmuBufferDesc.lpwfxFormat->nChannels * pThis->EmuBufferDesc.lpwfxFormat->wBitsPerSample / 8) * 32, static_cast<uint32_t>(pThis->EmuBufferDesc.lpwfxFormat->nBlockAlign) * 2);
}
leaveCriticalSection;

View File

@ -226,7 +226,7 @@ inline void GeneratePCMFormat(
lpwfxFormatHost->nChannels = 2;
lpwfxFormatHost->nSamplesPerSec = 44100;
lpwfxFormatHost->wBitsPerSample = 8;
lpwfxFormatHost->nBlockAlign = (lpwfxFormatHost->wBitsPerSample / 8 * lpwfxFormatHost->nChannels);
lpwfxFormatHost->nBlockAlign = lpwfxFormatHost->nChannels * lpwfxFormatHost->wBitsPerSample / 8;
lpwfxFormatHost->nAvgBytesPerSec = lpwfxFormatHost->nSamplesPerSec * lpwfxFormatHost->nBlockAlign;
}
else {
@ -249,7 +249,7 @@ inline void GeneratePCMFormat(
}
if (lpwfxFormatHost->nBlockAlign == 0) {
lpwfxFormatHost->nBlockAlign = (lpwfxFormatHost->wBitsPerSample / 8 * lpwfxFormatHost->nChannels);
lpwfxFormatHost->nBlockAlign = lpwfxFormatHost->nChannels * lpwfxFormatHost->wBitsPerSample / 8;
}
if (lpwfxFormatHost->nSamplesPerSec == 0) {