VirtualBox

Changeset 73466 in vbox for trunk/src


Ignore:
Timestamp:
Aug 3, 2018 9:41:27 AM (6 years ago)
Author:
vboxsync
Message:

Audio/HDA: Don't add the driver stream in hdaR3Attach() directly via hdaR3MixerAddDrvStream(); instead use hdaR3UpdateStream() so that also the codec gets notified of it.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Audio/DevHDA.cpp

    r73452 r73466  
    362362static int                        hdaR3AddStream(PHDASTATE pThis, PPDMAUDIOSTREAMCFG pCfg);
    363363static int                        hdaR3RemoveStream(PHDASTATE pThis, PPDMAUDIOSTREAMCFG pCfg);
     364static int                        hdaR3UpdateStream(PHDASTATE pThis, PPDMAUDIOSTREAMCFG pCfg);
    364365# ifdef HDA_USE_DMA_ACCESS_HANDLER
    365366static DECLCALLBACK(VBOXSTRICTRC) hdaR3DMAAccessHandler(PVM pVM, PVMCPU pVCpu, RTGCPHYS GCPhys, void *pvPhys,
     
    20242025}
    20252026
     2027/**
     2028 * Updates an audio device stream with the given configuration.
     2029 *
     2030 * @returns IPRT status code.
     2031 * @param   pThis               HDA state.
     2032 * @param   pCfg                Stream configuration to apply.
     2033 */
     2034static int hdaR3UpdateStream(PHDASTATE pThis, PPDMAUDIOSTREAMCFG pCfg)
     2035{
     2036    /* Remove the old stream from the device setup. */
     2037    hdaR3RemoveStream(pThis, pCfg);
     2038
     2039    /* Add the stream to the device setup. */
     2040    return hdaR3AddStream(pThis, pCfg);
     2041}
    20262042#endif /* IN_RING3 */
    20272043
     
    45294545        PHDASTREAM pStream = hdaR3GetStreamFromSink(pThis, &pThis->SinkFront);
    45304546        if (DrvAudioHlpStreamCfgIsValid(&pStream->State.Cfg))
    4531             hdaR3MixerAddDrvStream(pThis, pThis->SinkFront.pMixSink,     &pStream->State.Cfg, pDrv);
    4532 
     4547        {
     4548            rc2 = hdaR3UpdateStream(pThis, &pStream->State.Cfg);
     4549            AssertRC(rc2);
     4550        }
    45334551#ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND
    45344552        pStream = hdaR3GetStreamFromSink(pThis, &pThis->SinkCenterLFE);
    45354553        if (DrvAudioHlpStreamCfgIsValid(&pStream->State.Cfg))
    4536             hdaR3MixerAddDrvStream(pThis, pThis->SinkCenterLFE.pMixSink, &pStream->State.Cfg, pDrv);
     4554        {
     4555            rc2 = hdaR3UpdateStream(pThis, &pStream->State.Cfg);
     4556            AssertRC(rc2);
     4557        }
    45374558
    45384559        pStream = hdaR3GetStreamFromSink(pThis, &pThis->SinkRear);
    45394560        if (DrvAudioHlpStreamCfgIsValid(&pStream->State.Cfg))
    4540             hdaR3MixerAddDrvStream(pThis, pThis->SinkRear.pMixSink,      &pStream->State.Cfg, pDrv);
     4561        {
     4562            rc2 = hdaR3UpdateStream(pThis, &pStream->State.Cfg);
     4563            AssertRC(rc2);
     4564        }
    45414565#endif
    45424566        pStream = hdaR3GetStreamFromSink(pThis, &pThis->SinkLineIn);
    45434567        if (DrvAudioHlpStreamCfgIsValid(&pStream->State.Cfg))
    4544             hdaR3MixerAddDrvStream(pThis, pThis->SinkLineIn.pMixSink,    &pStream->State.Cfg, pDrv);
     4568        {
     4569            rc2 = hdaR3UpdateStream(pThis, &pStream->State.Cfg);
     4570            AssertRC(rc2);
     4571        }
    45454572
    45464573#ifdef VBOX_WITH_AUDIO_HDA_MIC_IN
    45474574        pStream = hdaR3GetStreamFromSink(pThis, &pThis->SinkMicIn);
    45484575        if (DrvAudioHlpStreamCfgIsValid(&pStream->State.Cfg))
    4549             hdaR3MixerAddDrvStream(pThis, pThis->SinkMicIn.pMixSink,     &pStream->State.Cfg, pDrv);
     4576        {
     4577            rc2 = hdaR3UpdateStream(pThis, &pStream->State.Cfg);
     4578            AssertRC(rc2);
     4579        }
    45504580#endif
    45514581    }
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette