VirtualBox

Changeset 76701 in vbox


Ignore:
Timestamp:
Jan 8, 2019 11:07:10 AM (6 years ago)
Author:
vboxsync
Message:

Audio/AC97: Moved setting the Hz rate / scheduling hint a bit more to the top so that it actually gets set when creating a stream.

File:
1 edited

Legend:

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

    r76700 r76701  
    20232023                Assert(Cfg.enmDir != PDMAUDIODIR_UNKNOWN);
    20242024
    2025                 if (pStream->State.pCircBuf)
    2026                 {
    2027                     RTCircBufDestroy(pStream->State.pCircBuf);
    2028                     pStream->State.pCircBuf = NULL;
    2029                 }
    2030 
    2031                 rc = RTCircBufCreate(&pStream->State.pCircBuf, DrvAudioHlpMilliToBytes(100 /* ms */, &Cfg.Props)); /** @todo Make this configurable. */
    2032                 if (RT_SUCCESS(rc))
    2033                 {
    2034                     ichac97R3MixerRemoveDrvStreams(pThis, pMixSink, Cfg.enmDir, Cfg.DestSource);
    2035 
    2036                     rc = ichac97R3MixerAddDrvStreams(pThis, pMixSink, &Cfg);
    2037                     if (RT_SUCCESS(rc))
    2038                         rc = DrvAudioHlpStreamCfgCopy(&pStream->State.Cfg, &Cfg);
    2039                 }
    2040 
    20412025                /*
    20422026                 * Set the stream's timer Hz rate, based on the PCM properties Hz rate.
     
    20552039                if (pStream->State.uTimerHz)
    20562040                    Cfg.Device.uSchedulingHintMs = 1000 /* ms */ / pStream->State.uTimerHz;
     2041
     2042                if (pStream->State.pCircBuf)
     2043                {
     2044                    RTCircBufDestroy(pStream->State.pCircBuf);
     2045                    pStream->State.pCircBuf = NULL;
     2046                }
     2047
     2048                rc = RTCircBufCreate(&pStream->State.pCircBuf, DrvAudioHlpMilliToBytes(100 /* ms */, &Cfg.Props)); /** @todo Make this configurable. */
     2049                if (RT_SUCCESS(rc))
     2050                {
     2051                    ichac97R3MixerRemoveDrvStreams(pThis, pMixSink, Cfg.enmDir, Cfg.DestSource);
     2052
     2053                    rc = ichac97R3MixerAddDrvStreams(pThis, pMixSink, &Cfg);
     2054                    if (RT_SUCCESS(rc))
     2055                        rc = DrvAudioHlpStreamCfgCopy(&pStream->State.Cfg, &Cfg);
     2056                }
    20572057
    20582058                /*
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