VirtualBox

Changeset 64389 in vbox


Ignore:
Timestamp:
Oct 24, 2016 2:17:11 PM (8 years ago)
Author:
vboxsync
Message:

Audio/DevIchAc97.cpp: Check if mixer sink is available in ichac97MixerSetVolume() + ichac97StreamEnable().

File:
1 edited

Legend:

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

    r64387 r64389  
    568568
    569569    PAUDMIXSINK pSink = ichac97IndexToSink(pThis, pStream->u8Strm);
    570     AssertPtr(pSink);
     570    if (!pSink) /* No sink available (yet)? Bail out early. */
     571        return VINF_SUCCESS;
    571572
    572573    const bool fIsEnabled = AudioMixerSinkGetStatus(pSink) & AUDMIXSINK_STS_RUNNING;
     
    11211122    Log(("-> fMuted=%RTbool, lVol=%RU8, rVol=%RU8\n", fCntlMuted, lVol, rVol));
    11221123
    1123     int rc;
     1124    int rc = VINF_SUCCESS;
    11241125
    11251126    if (pThis->pMixer) /* Device can be in reset state, so no mixer available. */
    11261127    {
    1127         PDMAUDIOVOLUME Vol = { fCntlMuted, lVol, rVol };
     1128        PDMAUDIOVOLUME Vol   = { fCntlMuted, lVol, rVol };
     1129        PAUDMIXSINK    pSink = NULL;
     1130
    11281131        switch (enmMixerCtl)
    11291132        {
    11301133            case PDMAUDIOMIXERCTL_VOLUME_MASTER:
    1131                 rc = AudioMixerSetMasterVolume(pThis->pMixer,    &Vol);
     1134                rc = AudioMixerSetMasterVolume(pThis->pMixer, &Vol);
    11321135                break;
     1136
    11331137            case PDMAUDIOMIXERCTL_FRONT:
    1134                 rc = AudioMixerSinkSetVolume(pThis->pSinkOut,    &Vol);
     1138                pSink = pThis->pSinkOut;
    11351139                break;
    11361140
    11371141            case PDMAUDIOMIXERCTL_MIC_IN:
    1138                 rc = AudioMixerSinkSetVolume(pThis->pSinkMicIn,  &Vol);
     1142                pSink = pThis->pSinkMicIn;
    11391143                break;
    11401144
    11411145            case PDMAUDIOMIXERCTL_LINE_IN:
    1142                 rc = AudioMixerSinkSetVolume(pThis->pSinkLineIn, &Vol);
     1146                pSink = pThis->pSinkLineIn;
    11431147                break;
    11441148
     
    11481152                break;
    11491153        }
    1150     }
    1151     else
    1152         rc = VINF_SUCCESS;
     1154
     1155        if (pSink)
     1156            rc = AudioMixerSinkSetVolume(pSink, &Vol);
     1157    }
    11531158
    11541159    ichac97MixerSet(pThis, index, uVal);
     
    19421947    PAC97BMREGS pRegs   = NULL;
    19431948
    1944     PAUDMIXSINK pSink   = NULL;
    1945 
    19461949    if (pStream)
    19471950    {
    19481951        pRegs = &pStream->Regs;
    1949         pSink = ichac97IndexToSink(pThis, pStream->u8Strm);
    1950         AssertPtr(pSink);
    19511952
    19521953        int rc2 = RTCritSectEnter(&pStream->CritSect);
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