Changeset 59029 in vbox for trunk/src/VBox/Devices/Audio
- Timestamp:
- Dec 7, 2015 4:11:22 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DrvHostDSound.cpp
r58983 r59029 719 719 } 720 720 721 static void directSoundPlayStop(PDRVHOSTDSOUND pThis, PDSOUNDSTREAMOUT pDSoundStrmOut) 722 { 723 AssertPtrReturnVoid(pThis); 724 AssertPtrReturnVoid(pDSoundStrmOut); 721 static HRESULT directSoundPlayStop(PDRVHOSTDSOUND pThis, PDSOUNDSTREAMOUT pDSoundStrmOut) 722 { 723 AssertPtrReturn(pThis, E_POINTER); 724 AssertPtrReturn(pDSoundStrmOut, E_POINTER); 725 726 HRESULT hr; 725 727 726 728 if (pDSoundStrmOut->pDSB != NULL) … … 731 733 DSLOG(("DSound: Stopping playback\n")); 732 734 733 /* @todo Wait until all data in the buffer has been played. */734 HRESULThr = IDirectSoundBuffer8_Stop(pDSoundStrmOut->pDSB);735 /** @todo Wait until all data in the buffer has been played. */ 736 hr = IDirectSoundBuffer8_Stop(pDSoundStrmOut->pDSB); 735 737 if (SUCCEEDED(hr)) 736 738 dsoundPlayClearSamples(pDSoundStrmOut); … … 738 740 DSLOGREL(("DSound: Stop playback %Rhrc\n", hr)); 739 741 } 742 else 743 hr = E_UNEXPECTED; 744 745 return hr; 740 746 } 741 747 … … 1013 1019 } 1014 1020 1015 static void directSoundCaptureStop(PDSOUNDSTREAMIN pDSoundStrmIn) 1016 { 1017 AssertPtrReturnVoid(pDSoundStrmIn); 1021 static HRESULT directSoundCaptureStop(PDSOUNDSTREAMIN pDSoundStrmIn) 1022 { 1023 AssertPtrReturn(pDSoundStrmIn, E_POINTER); 1024 1025 HRESULT hr; 1018 1026 1019 1027 if (pDSoundStrmIn->pDSCB) … … 1021 1029 DSLOG(("DSound: Stopping capture\n")); 1022 1030 1023 HRESULThr = IDirectSoundCaptureBuffer_Stop(pDSoundStrmIn->pDSCB);1031 hr = IDirectSoundCaptureBuffer_Stop(pDSoundStrmIn->pDSCB); 1024 1032 if (FAILED(hr)) 1025 1033 DSLOGREL(("DSound: Capture buffer stop %Rhrc\n", hr)); 1026 1034 } 1035 else 1036 hr = E_UNEXPECTED; 1037 1038 return hr; 1027 1039 } 1028 1040 … … 1221 1233 1222 1234 int rc = VINF_SUCCESS; 1235 1236 HRESULT hr; 1223 1237 switch (enmStreamCmd) 1224 1238 { … … 1227 1241 DSLOG(("DSound: Playback PDMAUDIOSTREAMCMD_ENABLE\n")); 1228 1242 /* Try to start playback. If it fails, then reopen and try again. */ 1229 HRESULThr = directSoundPlayStart(pDSoundStrmOut);1243 hr = directSoundPlayStart(pDSoundStrmOut); 1230 1244 if (FAILED(hr)) 1231 1245 { … … 1246 1260 { 1247 1261 DSLOG(("DSound: Playback PDMAUDIOSTREAMCMD_DISABLE\n")); 1248 directSoundPlayStop(pThis, pDSoundStrmOut); 1262 hr = directSoundPlayStop(pThis, pDSoundStrmOut); 1263 if (SUCCEEDED(hr)) 1264 pThis->fEnabledOut = false; 1249 1265 break; 1250 1266 } … … 1466 1482 int rc = VINF_SUCCESS; 1467 1483 1484 HRESULT hr; 1468 1485 switch (enmStreamCmd) 1469 1486 { … … 1471 1488 { 1472 1489 /* Try to start capture. If it fails, then reopen and try again. */ 1473 HRESULThr = directSoundCaptureStart(pThis, pDSoundStrmIn);1490 hr = directSoundCaptureStart(pThis, pDSoundStrmIn); 1474 1491 if (FAILED(hr)) 1475 1492 { … … 1489 1506 case PDMAUDIOSTREAMCMD_DISABLE: 1490 1507 { 1491 directSoundCaptureStop(pDSoundStrmIn); 1508 hr = directSoundCaptureStop(pDSoundStrmIn); 1509 if (SUCCEEDED(hr)) 1510 pThis->fEnabledIn = false; 1492 1511 break; 1493 1512 }
Note:
See TracChangeset
for help on using the changeset viewer.