VirtualBox

Changeset 88731 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Apr 27, 2021 12:10:00 PM (4 years ago)
Author:
vboxsync
Message:

Audio: Fixed and tightened audio stream state assertions. Doc updates. bugref:9890

File:
1 edited

Legend:

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

    r88726 r88731  
    10841084
    10851085    pStreamEx->Core.fStatus |= PDMAUDIOSTREAM_STS_INITIALIZED;
     1086    PDMAUDIOSTREAM_STS_ASSERT_VALID(pStreamEx->Core.fStatus);
    10861087
    10871088    return VINF_SUCCESS;
     
    14971498
    14981499        pStreamEx->Core.fStatus &= ~PDMAUDIOSTREAM_STS_INITIALIZED;
     1500        PDMAUDIOSTREAM_STS_ASSERT_VALID(pStreamEx->Core.fStatus);
    14991501    }
    15001502
     
    17501752                /* Remove the pending re-init flag on success. */
    17511753                pStreamEx->Core.fStatus &= ~PDMAUDIOSTREAM_STS_NEED_REINIT;
     1754                PDMAUDIOSTREAM_STS_ASSERT_VALID(pStreamEx->Core.fStatus);
    17521755            }
    17531756            else
     
    17671770
    17681771                /* Don't try to re-initialize anymore and mark as disabled. */
     1772                /** @todo should mark it as not-initialized too, shouldn't we?   */
    17691773                pStreamEx->Core.fStatus &= ~(PDMAUDIOSTREAM_STS_NEED_REINIT | PDMAUDIOSTREAM_STS_ENABLED);
     1774                PDMAUDIOSTREAM_STS_ASSERT_VALID(pStreamEx->Core.fStatus);
    17701775
    17711776                /* Note: Further writes to this stream go to / will be read from the bit bucket (/dev/null) from now on. */
     
    19651970
    19661971                if (RT_SUCCESS(rc))
     1972                {
    19671973                    pStreamEx->Core.fStatus |= PDMAUDIOSTREAM_STS_ENABLED;
     1974                    PDMAUDIOSTREAM_STS_ASSERT_VALID(pStreamEx->Core.fStatus);
     1975                }
    19681976            }
    19691977            break;
     
    19831991                    LogFunc(("[%s] Pending disable/pause\n", pStreamEx->Core.szName));
    19841992                    pStreamEx->Core.fStatus |= PDMAUDIOSTREAM_STS_PENDING_DISABLE;
     1993                    PDMAUDIOSTREAM_STS_ASSERT_VALID(pStreamEx->Core.fStatus);
    19851994
    19861995                    /* Schedule a follow up timer to the pending-disable state.  We cannot rely
     
    20142023                rc = drvAudioStreamControlInternalBackend(pThis, pStreamEx, PDMAUDIOSTREAMCMD_PAUSE);
    20152024                if (RT_SUCCESS(rc))
     2025                {
    20162026                    pStreamEx->Core.fStatus |= PDMAUDIOSTREAM_STS_PAUSED;
     2027                    PDMAUDIOSTREAM_STS_ASSERT_VALID(pStreamEx->Core.fStatus);
     2028                }
    20172029            }
    20182030            break;
     
    20252037                rc = drvAudioStreamControlInternalBackend(pThis, pStreamEx, PDMAUDIOSTREAMCMD_RESUME);
    20262038                if (RT_SUCCESS(rc))
     2039                {
    20272040                    pStreamEx->Core.fStatus &= ~PDMAUDIOSTREAM_STS_PAUSED;
     2041                    PDMAUDIOSTREAM_STS_ASSERT_VALID(pStreamEx->Core.fStatus);
     2042                }
    20282043            }
    20292044            break;
     
    23512366                    {
    23522367                        pStreamEx->Core.fStatus &= ~(PDMAUDIOSTREAM_STS_ENABLED | PDMAUDIOSTREAM_STS_PENDING_DISABLE);
     2368                        PDMAUDIOSTREAM_STS_ASSERT_VALID(pStreamEx->Core.fStatus);
    23532369                        drvAudioStreamDropInternal(pThis, pStreamEx); /* Not a DROP command, just a stream reset. */
    23542370                    }
     
    30473063    {
    30483064        pStreamEx->Core.fStatus |= PDMAUDIOSTREAM_STS_NEED_REINIT;
     3065        PDMAUDIOSTREAM_STS_ASSERT_VALID(pStreamEx->Core.fStatus);
    30493066        pStreamEx->cTriesReInit  = 0;
    30503067        pStreamEx->nsLastReInit  = 0;
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