VirtualBox

Changeset 67436 in vbox for trunk/src


Ignore:
Timestamp:
Jun 16, 2017 11:56:45 AM (8 years ago)
Author:
vboxsync
Message:

Audio/AudioMixer.cpp: Resolved deadlock in AudioMixerSinkGetWritable().

File:
1 edited

Legend:

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

    r67429 r67436  
    874874        return 0;
    875875
    876     if (   !(pSink->fStatus & AUDMIXSINK_STS_RUNNING)
    877         || pSink->fStatus & AUDMIXSINK_STS_PENDING_DISABLE)
    878     {
    879         return 0;
    880     }
    881 
    882876    uint32_t cbWritable = 0;
    883877
     878    if (    (pSink->fStatus & AUDMIXSINK_STS_RUNNING)
     879        && !(pSink->fStatus & AUDMIXSINK_STS_PENDING_DISABLE))
     880    {
    884881#ifdef VBOX_AUDIO_MIXER_WITH_MIXBUF
    885882# error "Implement me!"
    886883#else
    887     /* The hosts sets the pace --
    888      * so we try to find the minimum of writable data to all connected streams to this sink. */
    889     PAUDMIXSTREAM pMixStream;
    890     RTListForEach(&pSink->lstStreams, pMixStream, AUDMIXSTREAM, Node)
    891     {
    892         if (!(pMixStream->pConn->pfnStreamGetStatus(pMixStream->pConn, pMixStream->pStream) & PDMAUDIOSTRMSTS_FLAG_ENABLED))
    893         {
    894             Log3Func(("[%s] Stream '%s' disabled, skipping ...\n", pSink->pszName, pMixStream->pszName));
    895             continue;
    896         }
    897 
    898         const uint32_t cbWritableStream = pMixStream->pConn->pfnStreamGetWritable(pMixStream->pConn, pMixStream->pStream);
    899 
    900         if (cbWritable < cbWritableStream)
    901             cbWritable = cbWritableStream;
    902 
    903         break; /** @todo For now the first stream sets the pace. */
    904     }
     884        /* The hosts sets the pace --
     885         * so we try to find the minimum of writable data to all connected streams to this sink. */
     886        PAUDMIXSTREAM pMixStream;
     887        RTListForEach(&pSink->lstStreams, pMixStream, AUDMIXSTREAM, Node)
     888        {
     889            if (!(pMixStream->pConn->pfnStreamGetStatus(pMixStream->pConn, pMixStream->pStream) & PDMAUDIOSTRMSTS_FLAG_ENABLED))
     890            {
     891                Log3Func(("[%s] Stream '%s' disabled, skipping ...\n", pSink->pszName, pMixStream->pszName));
     892                continue;
     893            }
     894
     895            const uint32_t cbWritableStream = pMixStream->pConn->pfnStreamGetWritable(pMixStream->pConn, pMixStream->pStream);
     896
     897            if (cbWritable < cbWritableStream)
     898                cbWritable = cbWritableStream;
     899
     900            break; /** @todo For now the first stream sets the pace. */
     901        }
    905902#endif
     903    }
    906904
    907905    Log3Func(("[%s] cbWritable=%RU32\n", pSink->pszName, cbWritable));
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