Changeset 82579 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Dec 13, 2019 1:54:24 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 135459
- Location:
- trunk/src/VBox/Devices/Audio
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/AudioMixer.cpp
r82458 r82579 523 523 { 524 524 rc = audioMixerStreamCtlInternal(pStream, PDMAUDIOSTREAMCMD_ENABLE, AUDMIXSTRMCTL_F_NONE); 525 if (rc == VERR_AUDIO_STREAM_NOT_READY) 526 rc = VINF_SUCCESS; /* Not fatal here, stream can become available at some later point in time. */ 525 527 } 526 528 … … 576 578 return VERR_NO_MEMORY; 577 579 578 pMixStream->pszName = RTStrDup(pCfg->szName); 580 PDMAUDIOBACKENDCFG BackendCfg; 581 int rc = pConn->pfnGetConfig(pConn, &BackendCfg); 582 if (RT_FAILURE(rc)) 583 { 584 RTMemFree(pMixStream); 585 return rc; 586 } 587 588 /* Assign the backend's name to the mixer stream's name for easier identification in the (release) log. */ 589 pMixStream->pszName = RTStrAPrintf2("[%s] %s", pCfg->szName, BackendCfg.szName); 579 590 if (!pMixStream->pszName) 580 591 { … … 583 594 } 584 595 585 intrc = RTCritSectEnter(&pSink->CritSect);596 rc = RTCritSectEnter(&pSink->CritSect); 586 597 if (RT_FAILURE(rc)) 587 598 return rc; … … 1480 1491 int rc; 1481 1492 1482 if (pSink->In.pStreamRecSource) /* Disable old recording source, if any set. */1493 if (pSink->In.pStreamRecSource) /* First, disable old recording source, if any set. */ 1483 1494 { 1484 1495 const PPDMIAUDIOCONNECTOR pConn = pSink->In.pStreamRecSource->pConn; … … 1495 1506 AssertPtr(pStream->pStream); 1496 1507 AssertMsg(pStream->pStream->enmDir == PDMAUDIODIR_IN, ("Specified stream is not an input stream\n")); 1497 } 1498 1499 pSink->In.pStreamRecSource = pStream; 1500 1501 if (pSink->In.pStreamRecSource) 1502 { 1503 const PPDMIAUDIOCONNECTOR pConn = pSink->In.pStreamRecSource->pConn; 1504 AssertPtr(pConn); 1505 rc = pConn->pfnEnable(pConn, PDMAUDIODIR_IN, true /* Enable */); 1508 AssertPtr(pStream->pConn); 1509 rc = pStream->pConn->pfnEnable(pStream->pConn, PDMAUDIODIR_IN, true /* Enable */); 1510 if (RT_SUCCESS(rc)) 1511 { 1512 pSink->In.pStreamRecSource = pStream; 1513 } 1514 else if (pSink->In.pStreamRecSource->pConn) /* Stay with the current recording source (if any) and re-enable it. */ 1515 { 1516 const PPDMIAUDIOCONNECTOR pConn = pSink->In.pStreamRecSource->pConn; 1517 AssertPtr(pConn); 1518 rc = pConn->pfnEnable(pConn, PDMAUDIODIR_IN, true /* Enable */); 1519 } 1506 1520 } 1507 1521 } … … 1515 1529 pSink->pszName, pSink->In.pStreamRecSource ? pSink->In.pStreamRecSource->pszName : "<None>")); 1516 1530 } 1517 else 1531 else if (rc != VERR_AUDIO_STREAM_NOT_READY) 1532 { 1518 1533 LogRel(("Mixer: Setting recording source of sink '%s' to '%s' failed with %Rrc\n", 1519 1534 pSink->pszName, pSink->In.pStreamRecSource ? pSink->In.pStreamRecSource->pszName : "<None>", rc)); 1535 } 1520 1536 1521 1537 return rc; -
trunk/src/VBox/Devices/Audio/DrvAudio.cpp
r82458 r82579 514 514 { 515 515 if ( rc != VERR_NOT_IMPLEMENTED 516 && rc != VERR_NOT_SUPPORTED) 516 && rc != VERR_NOT_SUPPORTED 517 && rc != VERR_AUDIO_STREAM_NOT_READY) 518 { 517 519 LogRel(("Audio: %s stream '%s' failed with %Rrc\n", DrvAudioHlpStreamCmdToStr(enmStreamCmd), pStream->szName, rc)); 520 } 518 521 519 522 LogFunc(("[%s] %s failed with %Rrc\n", pStream->szName, DrvAudioHlpStreamCmdToStr(enmStreamCmd), rc)); … … 2664 2667 fEnable ? PDMAUDIOSTREAMCMD_ENABLE : PDMAUDIOSTREAMCMD_DISABLE); 2665 2668 if (RT_FAILURE(rc2)) 2666 LogRel(("Audio: Failed to %s %s stream '%s', rc=%Rrc\n", 2667 fEnable ? "enable" : "disable", enmDir == PDMAUDIODIR_IN ? "input" : "output", pStream->szName, rc2)); 2669 { 2670 if (rc2 == VERR_AUDIO_STREAM_NOT_READY) 2671 { 2672 LogRel(("Audio: Stream '%s' not available\n", pStream->szName)); 2673 } 2674 else 2675 LogRel(("Audio: Failed to %s %s stream '%s', rc=%Rrc\n", 2676 fEnable ? "enable" : "disable", enmDir == PDMAUDIODIR_IN ? "input" : "output", pStream->szName, rc2)); 2677 } 2668 2678 2669 2679 if (RT_SUCCESS(rc)) … … 3207 3217 LogFlowFunc(("[%s] cRefs=%RU32\n", pStream->szName, pStream->cRefs)); 3208 3218 3209 if (pStream->cRefs > 1) 3210 return VERR_WRONG_ORDER; 3219 AssertMsgReturn(pStream->cRefs <= 1, 3220 ("Stream '%s' still has %RU32 references held when uninitializing\n", pStream->szName, pStream->cRefs), 3221 VERR_WRONG_ORDER); 3211 3222 3212 3223 int rc = drvAudioStreamControlInternal(pThis, pStream, PDMAUDIOSTREAMCMD_DISABLE);
Note:
See TracChangeset
for help on using the changeset viewer.