VirtualBox

Changeset 65019 in vbox


Ignore:
Timestamp:
Dec 29, 2016 8:53:44 AM (8 years ago)
Author:
vboxsync
Message:

Audio/DevIchAc97.cpp: Make sure to also destroy all audio sinks in ichac97StreamsDestroy().

File:
1 edited

Legend:

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

    r65018 r65019  
    487487static void               ichac97DoTransfers(PAC97STATE pThis);
    488488
     489static int                ichac97MixerAddDrvStreams(PAC97STATE pThis, PAUDMIXSINK pMixSink, PPDMAUDIOSTREAMCFG pCfg);
     490static void               ichac97MixerRemoveDrvStreams(PAC97STATE pThis, PAUDMIXSINK pMixSink, PDMAUDIODIR enmDir, PDMAUDIODESTSOURCE dstSrc);
     491
    489492#ifdef VBOX_WITH_AUDIO_AC97_ASYNC_IO
    490493static DECLCALLBACK(int)  ichac97StreamAsyncIOThread(RTTHREAD hThreadSelf, void *pvUser);
     
    823826    LogFlowFuncEnter();
    824827
     828    /*
     829     * Destroy all AC'97 streams.
     830     */
     831
    825832    ichac97StreamDestroy(pThis, &pThis->StreamLineIn);
    826833    ichac97StreamDestroy(pThis, &pThis->StreamMicIn);
    827834    ichac97StreamDestroy(pThis, &pThis->StreamOut);
     835
     836    /*
     837     * Destroy all sinks.
     838     */
     839
     840    PDMAUDIODESTSOURCE dstSrc;
     841    if (pThis->pSinkLineIn)
     842    {
     843        dstSrc.Source = PDMAUDIORECSOURCE_LINE;
     844        ichac97MixerRemoveDrvStreams(pThis, pThis->pSinkLineIn, PDMAUDIODIR_IN, dstSrc);
     845
     846        AudioMixerSinkDestroy(pThis->pSinkLineIn);
     847        pThis->pSinkLineIn = NULL;
     848    }
     849
     850    if (pThis->pSinkMicIn)
     851    {
     852        dstSrc.Source = PDMAUDIORECSOURCE_MIC;
     853        ichac97MixerRemoveDrvStreams(pThis, pThis->pSinkMicIn, PDMAUDIODIR_IN, dstSrc);
     854
     855        AudioMixerSinkDestroy(pThis->pSinkMicIn);
     856        pThis->pSinkMicIn = NULL;
     857    }
     858
     859    if (pThis->pSinkOut)
     860    {
     861        dstSrc.Dest = PDMAUDIOPLAYBACKDEST_FRONT;
     862        ichac97MixerRemoveDrvStreams(pThis, pThis->pSinkOut, PDMAUDIODIR_OUT, dstSrc);
     863
     864        AudioMixerSinkDestroy(pThis->pSinkOut);
     865        pThis->pSinkOut = NULL;
     866    }
    828867}
    829868
     
    29082947            ichac97MixerSetVolume(pThis, AC97_Headphone_Volume_Mute, PDMAUDIOMIXERCTL_VOLUME_MASTER,
    29092948                             ichac97MixerGet(pThis, AC97_Headphone_Volume_Mute));
     2949
     2950    ichac97StreamsDestroy(pThis);
    29102951
    29112952    rc2 = ichac97StreamsCreate(pThis);
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