VirtualBox

Changeset 88717 in vbox for trunk/src


Ignore:
Timestamp:
Apr 26, 2021 8:50:18 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
144035
Message:

DrvAudio: Some more tidying up. bugref:9890

File:
1 edited

Legend:

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

    r88715 r88717  
    331331static int drvAudioDevicesEnumerateInternal(PDRVAUDIO pThis, bool fLog, PPDMAUDIOHOSTENUM pDevEnum);
    332332#endif
    333 
    334333static int drvAudioStreamControlInternalBackend(PDRVAUDIO pThis, PDRVAUDIOSTREAM pStreamEx, PDMAUDIOSTREAMCMD enmStreamCmd);
    335334static int drvAudioStreamControlInternal(PDRVAUDIO pThis, PDRVAUDIOSTREAM pStreamEx, PDMAUDIOSTREAMCMD enmStreamCmd);
    336335static int drvAudioStreamCreateInternalBackend(PDRVAUDIO pThis, PDRVAUDIOSTREAM pStreamEx, PPDMAUDIOSTREAMCFG pCfgReq, PPDMAUDIOSTREAMCFG pCfgAcq);
    337336static int drvAudioStreamDestroyInternalBackend(PDRVAUDIO pThis, PDRVAUDIOSTREAM pStreamEx);
    338 static void drvAudioStreamFree(PDRVAUDIOSTREAM pStream);
    339337static int drvAudioStreamUninitInternal(PDRVAUDIO pThis, PDRVAUDIOSTREAM pStreamEx);
    340338static int drvAudioStreamIterateInternal(PDRVAUDIO pThis, PDRVAUDIOSTREAM pStreamEx);
    341 static void drvAudioStreamDropInternal(PDRVAUDIO pThis, PDRVAUDIOSTREAM pStreamEx);
    342 static void drvAudioStreamResetInternal(PDRVAUDIO pThis, PDRVAUDIOSTREAM pStreamEx);
    343339
    344340
     
    421417}
    422418
     419
     420/**
     421 * Drops all audio data (and associated state) of a stream.
     422 *
     423 * @param   pThis       Pointer to driver instance.
     424 * @param   pStreamEx   Stream to drop data for.
     425 */
     426static void drvAudioStreamDropInternal(PDRVAUDIO pThis, PDRVAUDIOSTREAM pStreamEx)
     427{
     428    RT_NOREF(pThis);
     429
     430    LogFunc(("[%s]\n", pStreamEx->Core.szName));
     431
     432    if (pStreamEx->fNoMixBufs)
     433    {
     434        AudioMixBufReset(&pStreamEx->Guest.MixBuf);
     435        AudioMixBufReset(&pStreamEx->Host.MixBuf);
     436    }
     437
     438    pStreamEx->fThresholdReached    = false;
     439    pStreamEx->nsLastIterated       = 0;
     440    pStreamEx->nsLastPlayedCaptured = 0;
     441    pStreamEx->nsLastReadWritten    = 0;
     442}
     443
     444
    423445#ifdef VBOX_WITH_AUDIO_CALLBACKS
    424446/**
     
    436458    RTListForEach(&pThis->lstStreams, pStreamEx, DRVAUDIOSTREAM, ListEntry)
    437459    {
    438         pStreamEx->Core.fStatus        |= PDMAUDIOSTREAMSTS_FLAGS_PENDING_REINIT;
    439         pStreamEx->cTriesReInit    = 0;
    440         pStreamEx->nsLastReInit         = 0;
     460        pStreamEx->Core.fStatus |= PDMAUDIOSTREAMSTS_FLAGS_PENDING_REINIT;
     461        pStreamEx->cTriesReInit  = 0;
     462        pStreamEx->nsLastReInit  = 0;
    441463    }
    442464
     
    447469}
    448470#endif /* VBOX_WITH_AUDIO_CALLBACKS */
     471
    449472
    450473/**
     
    511534}
    512535
    513 /**
    514  * Drops all audio data (and associated state) of a stream.
    515  *
    516  * @param   pThis       Pointer to driver instance.
    517  * @param   pStreamEx   Stream to drop data for.
    518  */
    519 static void drvAudioStreamDropInternal(PDRVAUDIO pThis, PDRVAUDIOSTREAM pStreamEx)
    520 {
    521     RT_NOREF(pThis);
    522 
    523     LogFunc(("[%s]\n", pStreamEx->Core.szName));
    524 
    525     if (pStreamEx->fNoMixBufs)
    526     {
    527         AudioMixBufReset(&pStreamEx->Guest.MixBuf);
    528         AudioMixBufReset(&pStreamEx->Host.MixBuf);
    529     }
    530 
    531     pStreamEx->fThresholdReached    = false;
    532     pStreamEx->nsLastIterated       = 0;
    533     pStreamEx->nsLastPlayedCaptured = 0;
    534     pStreamEx->nsLastReadWritten    = 0;
    535 }
    536536
    537537/**
     
    25022502 * @param   pThis       Pointer to driver instance.
    25032503 * @param   pStreamEx   Stream to iterate.
    2504  *
    2505  * @todo    r=bird: Don't know why the default behavior isn't to push data into
    2506  *          the backend...  We'll never get out of the pending-disable state if
    2507  *          the mixing buffer doesn't empty out.
    25082504 */
    25092505static int drvAudioStreamIterateInternal(PDRVAUDIO pThis, PDRVAUDIOSTREAM pStreamEx)
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette