VirtualBox

Changeset 89354 in vbox


Ignore:
Timestamp:
May 28, 2021 12:57:55 PM (4 years ago)
Author:
vboxsync
Message:

AudioMixBuffer: Fix. bugref:9890

File:
1 edited

Legend:

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

    r89352 r89354  
    924924 * Destroys (uninitializes) a mixing buffer.
    925925 *
    926  * @param   pMixBuf                 Mixing buffer to destroy.
     926 * @param   pMixBuf     The mixing buffer.  Uninitialized mixer buffers will be
     927 *                      quietly ignored.  As will NULL.
    927928 */
    928929void AudioMixBufDestroy(PAUDIOMIXBUF pMixBuf)
     
    933934    /* Ignore calls for an uninitialized (zeroed) or already destroyed instance.  Happens a lot. */
    934935    if (   pMixBuf->uMagic == 0
    935         || pMixBuf->uMagic == ~AUDIOMIXBUF_MAGIC)
     936        || pMixBuf->uMagic == AUDIOMIXBUF_MAGIC_DEAD)
    936937    {
    937938        Assert(!pMixBuf->pszName);
     
    969970 * This will reset the read and write offsets to zero.
    970971 *
    971  * @param   pMixBuf             The mixing buffer.
     972 * @param   pMixBuf     The mixing buffer.  Uninitialized mixer buffers will be
     973 *                      quietly ignored.
    972974 */
    973975void AudioMixBufDrop(PAUDIOMIXBUF pMixBuf)
    974976{
    975977    AssertPtrReturnVoid(pMixBuf);
    976     AssertReturnVoid(pMixBuf->uMagic == AUDIOMIXBUF_MAGIC);
     978
     979    /* Ignore uninitialized (zeroed) mixer sink buffers (happens with AC'97 during VM construction). */
     980    if (   pMixBuf->uMagic == 0
     981        || pMixBuf->uMagic == AUDIOMIXBUF_MAGIC_DEAD)
     982        return;
    977983
    978984    AUDMIXBUF_LOG(("%s\n", pMixBuf->pszName));
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