- Timestamp:
- Feb 8, 2017 11:53:48 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DrvHostDSound.cpp
r65674 r65676 469 469 static HRESULT directSoundPlayInterfaceCreate(PDRVHOSTDSOUND pThis, PDSOUNDSTREAM pStreamDS) 470 470 { 471 AssertPtrReturn(pThis, E_POINTER); 472 AssertPtrReturn(pStreamDS, E_POINTER); 473 471 474 if (pStreamDS->Out.pDS != NULL) 472 475 { … … 509 512 static HRESULT directSoundPlayClose(PDRVHOSTDSOUND pThis, PDSOUNDSTREAM pStreamDS) 510 513 { 511 AssertPtrReturn(pThis, E_POINTER);514 AssertPtrReturn(pThis, E_POINTER); 512 515 AssertPtrReturn(pStreamDS, E_POINTER); 513 516 … … 636 639 RT_ZERO(bc); 637 640 bc.dwSize = sizeof(bc); 641 638 642 hr = IDirectSoundBuffer8_GetCaps(pStreamDS->Out.pDSB, &bc); 639 643 if (FAILED(hr)) … … 770 774 static HRESULT directSoundPlayGetStatus(PDRVHOSTDSOUND pThis, LPDIRECTSOUNDBUFFER8 pDSB, DWORD *pdwStatus) 771 775 { 772 AssertPtr (pThis);776 AssertPtrReturn(pThis, E_POINTER); 773 777 AssertPtrReturn(pDSB, E_POINTER); 778 774 779 AssertPtrNull(pdwStatus); 775 780 … … 843 848 static HRESULT directSoundPlayStart(PDRVHOSTDSOUND pThis, PDSOUNDSTREAM pStreamDS) 844 849 { 845 AssertPtrReturn(pThis, 850 AssertPtrReturn(pThis, E_POINTER); 846 851 AssertPtrReturn(pStreamDS, E_POINTER); 847 852 … … 886 891 */ 887 892 888 static LPCGUID dsoundCaptureSelectDevice(PDRVHOSTDSOUND pThis, PDSOUNDSTREAM pStreamDS) 889 { 890 AssertPtrReturn(pThis, NULL); 891 AssertPtrReturn(pStreamDS, NULL); 892 AssertPtrReturn(pStreamDS->pCfg, NULL); 893 static LPCGUID dsoundCaptureSelectDevice(PDRVHOSTDSOUND pThis, PPDMAUDIOSTREAMCFG pCfg) 894 { 895 AssertPtrReturn(pThis, NULL); 896 AssertPtrReturn(pCfg, NULL); 893 897 894 898 int rc = VINF_SUCCESS; … … 899 903 PDSOUNDDEV pDev = NULL; 900 904 901 switch (p StreamDS->pCfg->DestSource.Source)905 switch (pCfg->DestSource.Source) 902 906 { 903 907 case PDMAUDIORECSOURCE_LINE: … … 932 936 { 933 937 DSLOG(("DSound: Guest source '%s' is using host recording device '%s'\n", 934 DrvAudioHlpRecSrcToStr(p StreamDS->pCfg->DestSource.Source), pDev->pszName));938 DrvAudioHlpRecSrcToStr(pCfg->DestSource.Source), pDev->pszName)); 935 939 936 940 pGUID = &pDev->Guid; … … 948 952 /* This always has to be in the release log. */ 949 953 LogRel(("DSound: Guest source '%s' is using host recording device with GUID '%s'\n", 950 DrvAudioHlpRecSrcToStr(p StreamDS->pCfg->DestSource.Source), pszGUID ? pszGUID: "{?}"));954 DrvAudioHlpRecSrcToStr(pCfg->DestSource.Source), pszGUID ? pszGUID: "{?}")); 951 955 952 956 if (pszGUID) … … 971 975 972 976 973 static HRESULT directSoundCaptureInterfaceCreate(PDRVHOSTDSOUND pThis, PDSOUNDSTREAM pStreamDS) 974 { 977 static HRESULT directSoundCaptureInterfaceCreate(PDRVHOSTDSOUND pThis, PDSOUNDSTREAM pStreamDS, PPDMAUDIOSTREAMCFG pCfg) 978 { 979 AssertPtrReturn(pThis, E_POINTER); 980 AssertPtrReturn(pStreamDS, E_POINTER); 981 AssertPtrReturn(pCfg, E_POINTER); 982 975 983 if (pStreamDS->In.pDSC != NULL) 976 984 { … … 987 995 else 988 996 { 989 LPCGUID pGUID = dsoundCaptureSelectDevice(pThis, p StreamDS);997 LPCGUID pGUID = dsoundCaptureSelectDevice(pThis, pCfg); 990 998 hr = IDirectSoundCapture_Initialize(pStreamDS->In.pDSC, pGUID); 991 999 if (FAILED(hr)) … … 1061 1069 return E_INVALIDARG; 1062 1070 1063 HRESULT hr = directSoundCaptureInterfaceCreate(pThis, pStreamDS );1071 HRESULT hr = directSoundCaptureInterfaceCreate(pThis, pStreamDS, pCfgReq); 1064 1072 if (FAILED(hr)) 1065 1073 return hr; … … 1280 1288 1281 1289 RTMemFree(pDev); 1290 pDev = NULL; 1282 1291 } 1283 1292 } … … 1619 1628 directSoundPlayUnlock(pThis, pDSB, pv1, pv2, cb1, cb2); 1620 1629 1621 pStreamDS->Out.offPlayWritePos = (pStreamDS->Out.offPlayWritePos + PDMAUDIOPCMPROPS_S2B(pProps, cbWrittenTotal)) 1622 % cbBuffer; 1630 pStreamDS->Out.offPlayWritePos = (pStreamDS->Out.offPlayWritePos + cbWrittenTotal) % cbBuffer; 1623 1631 1624 1632 DSLOGF(("DSound: %RU32/%RU32, buffer write pos %ld, rc=%Rrc\n", 1625 PDMAUDIOPCMPROPS_S2B(pProps, cbWrittenTotal), cbLive, pStreamDS->Out.offPlayWritePos, rc));1633 cbWrittenTotal, cbLive, pStreamDS->Out.offPlayWritePos, rc)); 1626 1634 1627 1635 if (pStreamDS->Out.fRestartPlayback)
Note:
See TracChangeset
for help on using the changeset viewer.