Changeset 68893 in vbox
- Timestamp:
- Sep 27, 2017 4:25:53 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DrvAudio.cpp
r68868 r68893 1064 1064 AssertPtrReturn(pInterface, VERR_INVALID_POINTER); 1065 1065 AssertPtrReturn(pStream, VERR_INVALID_POINTER); 1066 /* pcData is optional. */1067 1066 1068 1067 PDRVAUDIO pThis = PDMIAUDIOCONNECTOR_2_DRVAUDIO(pInterface); … … 1096 1095 { 1097 1096 AssertPtrReturn(pThis, VERR_INVALID_POINTER); 1097 1098 if (!pThis->pHostDrvAudio) 1099 return VINF_SUCCESS; 1098 1100 1099 1101 if (!pStream) … … 1482 1484 { 1483 1485 if (!pThis->pHostDrvAudio) 1484 { 1485 rc = VERR_NOT_AVAILABLE; 1486 break; 1487 } 1486 break; 1488 1487 1489 1488 PPDMAUDIOSTREAM pHstStream = drvAudioGetHostStream(pStream); … … 1776 1775 do 1777 1776 { 1777 if (!pThis->pHostDrvAudio) 1778 break; 1779 1778 1780 PPDMAUDIOSTREAM pHstStream = drvAudioGetHostStream(pStream); 1779 1781 AssertPtr(pHstStream); … … 2253 2255 LogFlowFunc(("enmCmd=%s\n", DrvAudioHlpStreamCmdToStr(enmCmd))); 2254 2256 2257 int rc2 = RTCritSectEnter(&pThis->CritSect); 2258 AssertRC(rc2); 2259 2255 2260 if (!pThis->pHostDrvAudio) 2256 2261 return; … … 2259 2264 RTListForEach(&pThis->lstHstStreams, pHstStream, PDMAUDIOSTREAM, Node) 2260 2265 drvAudioStreamControlInternalBackend(pThis, pHstStream, enmCmd); 2266 2267 rc2 = RTCritSectLeave(&pThis->CritSect); 2268 AssertRC(rc2); 2261 2269 } 2262 2270 … … 3477 3485 { 3478 3486 drvAudioStateHandler(pDrvIns, PDMAUDIOSTREAMCMD_RESUME); 3487 } 3488 3489 /** 3490 * Attach notification. 3491 * 3492 * @param pDrvIns The driver instance data. 3493 */ 3494 static DECLCALLBACK(int) drvAudioAttach(PPDMDRVINS pDrvIns, uint32_t fFlags) 3495 { 3496 RT_NOREF(fFlags); 3497 3498 PDMDRV_CHECK_VERSIONS_RETURN(pDrvIns); 3499 PDRVAUDIO pThis = PDMINS_2_DATA(pDrvIns, PDRVAUDIO); 3500 3501 int rc2 = RTCritSectEnter(&pThis->CritSect); 3502 AssertRC(rc2); 3503 3504 int rc = VINF_SUCCESS; 3505 3506 LogFunc(("%s\n", pThis->szName)); 3507 3508 rc2 = RTCritSectLeave(&pThis->CritSect); 3509 if (RT_SUCCESS(rc)) 3510 rc = rc2; 3511 3512 return rc; 3513 } 3514 3515 /** 3516 * Detach notification. 3517 * 3518 * @param pDrvIns The driver instance data. 3519 */ 3520 static DECLCALLBACK(void) drvAudioDetach(PPDMDRVINS pDrvIns, uint32_t fFlags) 3521 { 3522 RT_NOREF(fFlags); 3523 3524 PDMDRV_CHECK_VERSIONS_RETURN_VOID(pDrvIns); 3525 PDRVAUDIO pThis = PDMINS_2_DATA(pDrvIns, PDRVAUDIO); 3526 3527 int rc2 = RTCritSectEnter(&pThis->CritSect); 3528 AssertRC(rc2); 3529 3530 pThis->pHostDrvAudio = NULL; 3531 3532 LogFunc(("%s\n", pThis->szName)); 3533 3534 rc2 = RTCritSectLeave(&pThis->CritSect); 3535 AssertRC(rc2); 3479 3536 } 3480 3537 … … 3519 3576 drvAudioResume, 3520 3577 /* pfnAttach */ 3521 NULL,3578 drvAudioAttach, 3522 3579 /* pfnDetach */ 3523 NULL,3580 drvAudioDetach, 3524 3581 /* pfnPowerOff */ 3525 3582 drvAudioPowerOff,
Note:
See TracChangeset
for help on using the changeset viewer.