Changeset 88022 in vbox for trunk/src/VBox/Devices/Audio/DrvHostDSound.cpp
- Timestamp:
- Mar 8, 2021 5:50:57 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DrvHostDSound.cpp
r87994 r88022 666 666 */ 667 667 bd.dwFlags = DSBCAPS_GLOBALFOCUS | DSBCAPS_GETCURRENTPOSITION2 | DSBCAPS_LOCSOFTWARE; 668 bd.dwBufferBytes = DrvAudioHlpFramesToBytes(&pCfgReq->Props, pCfgReq->Backend.cFramesBufferSize);668 bd.dwBufferBytes = PDMAudioPropsFramesToBytes(&pCfgReq->Props, pCfgReq->Backend.cFramesBufferSize); 669 669 670 670 DSLOG(("DSound: Requested playback buffer is %RU64ms (%ld bytes)\n", 671 DrvAudioHlpBytesToMilli(&pCfgReq->Props, bd.dwBufferBytes), bd.dwBufferBytes));671 PDMAudioPropsBytesToMilli(&pCfgReq->Props, bd.dwBufferBytes), bd.dwBufferBytes)); 672 672 673 673 hr = IDirectSound8_CreateSoundBuffer(pThis->pDS, &bd, &pDSB, NULL); … … 711 711 712 712 DSLOG(("DSound: Acquired playback buffer is %RU64ms (%ld bytes)\n", 713 DrvAudioHlpBytesToMilli(&pCfgReq->Props, bc.dwBufferBytes), bc.dwBufferBytes));713 PDMAudioPropsBytesToMilli(&pCfgReq->Props, bc.dwBufferBytes), bc.dwBufferBytes)); 714 714 715 715 DSLOG(("DSound: Acquired playback format:\n" … … 779 779 if (SUCCEEDED(hr)) 780 780 { 781 DrvAudioHlpClearBuf(pProps, pv1, pStreamDS->cbBufSize, PDMAUDIOPCMPROPS_B2F(pProps, pStreamDS->cbBufSize));781 PDMAudioPropsClearBuffer(pProps, pv1, pStreamDS->cbBufSize, PDMAUDIOPCMPROPS_B2F(pProps, pStreamDS->cbBufSize)); 782 782 783 783 directSoundPlayUnlock(pThis, pStreamDS->Out.pDSB, pv1, NULL, 0, 0); … … 895 895 896 896 if ( pStreamDS->Out.fFirstTransfer 897 && pStreamDS->Out.cbTransferred >= DrvAudioHlpFramesToBytes(&pStreamDS->Cfg.Props, pStreamDS->Cfg.Backend.cFramesPreBuffering))897 && pStreamDS->Out.cbTransferred >= PDMAudioPropsFramesToBytes(&pStreamDS->Cfg.Props, pStreamDS->Cfg.Backend.cFramesPreBuffering)) 898 898 { 899 899 hr = directSoundPlayStart(pThis, pStreamDS); … … 1041 1041 if (SUCCEEDED(hr)) 1042 1042 { 1043 DrvAudioHlpClearBuf(&pStreamDS->Cfg.Props, pv1, cb1, PDMAUDIOPCMPROPS_B2F(&pStreamDS->Cfg.Props, cb1));1043 PDMAudioPropsClearBuffer(&pStreamDS->Cfg.Props, pv1, cb1, PDMAUDIOPCMPROPS_B2F(&pStreamDS->Cfg.Props, cb1)); 1044 1044 if (pv2 && cb2) 1045 DrvAudioHlpClearBuf(&pStreamDS->Cfg.Props, pv2, cb2, PDMAUDIOPCMPROPS_B2F(&pStreamDS->Cfg.Props, cb2));1045 PDMAudioPropsClearBuffer(&pStreamDS->Cfg.Props, pv2, cb2, PDMAUDIOPCMPROPS_B2F(&pStreamDS->Cfg.Props, cb2)); 1046 1046 directSoundCaptureUnlock(pStreamDS->In.pDSCB, pv1, pv2, cb1, cb2); 1047 1047 } … … 1076 1076 if (SUCCEEDED(hr)) 1077 1077 { 1078 DrvAudioHlpClearBuf(&pStreamDS->Cfg.Props, pv1, cb1, PDMAUDIOPCMPROPS_B2F(&pStreamDS->Cfg.Props, cb1));1078 PDMAudioPropsClearBuffer(&pStreamDS->Cfg.Props, pv1, cb1, PDMAUDIOPCMPROPS_B2F(&pStreamDS->Cfg.Props, cb1)); 1079 1079 if (pv2 && cb2) 1080 DrvAudioHlpClearBuf(&pStreamDS->Cfg.Props, pv2, cb2, PDMAUDIOPCMPROPS_B2F(&pStreamDS->Cfg.Props, cb2));1080 PDMAudioPropsClearBuffer(&pStreamDS->Cfg.Props, pv2, cb2, PDMAUDIOPCMPROPS_B2F(&pStreamDS->Cfg.Props, cb2)); 1081 1081 directSoundPlayUnlock(pThis, pStreamDS->Out.pDSB, pv1, pv2, cb1, cb2); 1082 1082 } … … 1401 1401 bd.dwSize = sizeof(bd); 1402 1402 bd.lpwfxFormat = &wfx; 1403 bd.dwBufferBytes = DrvAudioHlpFramesToBytes(&pCfgReq->Props, pCfgReq->Backend.cFramesBufferSize);1403 bd.dwBufferBytes = PDMAudioPropsFramesToBytes(&pCfgReq->Props, pCfgReq->Backend.cFramesBufferSize); 1404 1404 1405 1405 DSLOG(("DSound: Requested capture buffer is %RU64ms (%ld bytes)\n", 1406 DrvAudioHlpBytesToMilli(&pCfgReq->Props, bd.dwBufferBytes), bd.dwBufferBytes));1406 PDMAudioPropsBytesToMilli(&pCfgReq->Props, bd.dwBufferBytes), bd.dwBufferBytes)); 1407 1407 1408 1408 LPDIRECTSOUNDCAPTUREBUFFER pDSCB; … … 1457 1457 1458 1458 DSLOG(("DSound: Acquired capture buffer is %RU64ms (%ld bytes)\n", 1459 DrvAudioHlpBytesToMilli(&pCfgReq->Props, bc.dwBufferBytes), bc.dwBufferBytes));1459 PDMAudioPropsBytesToMilli(&pCfgReq->Props, bc.dwBufferBytes), bc.dwBufferBytes)); 1460 1460 1461 1461 DSLOG(("DSound: Capture format:\n" … … 2500 2500 { 2501 2501 const uint64_t diffLastTransferredMs = RTTimeMilliTS() - pStreamDS->Out.tsLastTransferredMs; 2502 const uint64_t uLastTranserredChunkMs = DrvAudioHlpBytesToMilli(&pStreamDS->Cfg.Props, pStreamDS->Out.cbLastTransferred);2502 const uint64_t uLastTranserredChunkMs = PDMAudioPropsBytesToMilli(&pStreamDS->Cfg.Props, pStreamDS->Out.cbLastTransferred); 2503 2503 if ( uLastTranserredChunkMs 2504 2504 && diffLastTransferredMs < uLastTranserredChunkMs)
Note:
See TracChangeset
for help on using the changeset viewer.