VirtualBox

Changeset 63816 in vbox


Ignore:
Timestamp:
Sep 13, 2016 4:03:33 PM (8 years ago)
Author:
vboxsync
Message:

Audio/DevIchAc97.cpp: Check the stream's status register if a device stream state change actually is required.

File:
1 edited

Legend:

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

    r63813 r63816  
    557557    AssertPtrReturn(pStream, VERR_INVALID_POINTER);
    558558
     559    /* Check the stream's status register if a state change actually is required. */
     560    const bool fIsActive = RT_BOOL(pStream->Regs.sr & AC97_SR_DCH);
     561
     562    LogFunc(("[SD%RU8] fActive=%RTbool, fIsActive=%RTbool, cStreamsActive=%RU8\n",
     563             pStream->u8Strm, fActive, fIsActive, pThis->cStreamsActive));
     564
     565    if (fIsActive == fActive) /* Is a change required? */
     566        return VINF_SUCCESS;
     567
    559568    if (!fActive)
    560569    {
     
    574583    }
    575584
    576     int rc = AudioMixerSinkCtl(ichac97IndexToSink(pThis, pStream->u8Strm),
    577                                fActive ? AUDMIXSINKCMD_ENABLE : AUDMIXSINKCMD_DISABLE);
    578 
    579     LogFlowFunc(("[SD%RU8] fActive=%RTbool, cStreamsActive=%RU8, rc=%Rrc\n",
    580                  pStream->u8Strm, fActive, pThis->cStreamsActive, rc));
    581 
    582     return rc;
     585    return AudioMixerSinkCtl(ichac97IndexToSink(pThis, pStream->u8Strm),
     586                             fActive ? AUDMIXSINKCMD_ENABLE : AUDMIXSINKCMD_DISABLE);
    583587}
    584588
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