VirtualBox

Changeset 63749 in vbox for trunk


Ignore:
Timestamp:
Sep 7, 2016 1:54:47 PM (8 years ago)
Author:
vboxsync
Message:

Audio/DrvHostALSAAudio.cpp: Fixed recording.

File:
1 edited

Legend:

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

    r63711 r63749  
    16861686                              | PDMAUDIOSTRMSTS_FLAG_ENABLED;
    16871687
     1688    snd_pcm_t         *phPCM       = NULL;
     1689    snd_pcm_sframes_t  cSamplesMin;
     1690
     1691    /** @todo Get rid of this once we have a unified ALSA stream. */
    16881692    if (pStream->enmDir == PDMAUDIODIR_IN)
    16891693    {
    1690 
     1694        PALSAAUDIOSTREAMIN pStreamIn = (PALSAAUDIOSTREAMIN)pStream;
     1695        phPCM       = pStreamIn->phPCM;
     1696        cSamplesMin = 0;
     1697    }
     1698    else if (pStream->enmDir == PDMAUDIODIR_OUT)
     1699    {
     1700        PALSAAUDIOSTREAMOUT pStreamOut = (PALSAAUDIOSTREAMOUT)pStream;
     1701        phPCM       = pStreamOut->phPCM;
     1702        cSamplesMin = pStreamOut->cSamplesMin;
    16911703    }
    16921704    else
    1693     {
    1694         PALSAAUDIOSTREAMOUT pStreamOut = (PALSAAUDIOSTREAMOUT)pStream;
    1695 
    1696         snd_pcm_sframes_t cAvail;
    1697         int rc2 = alsaStreamGetAvail(pStreamOut->phPCM, &cAvail);
     1705        AssertFailed();
     1706
     1707    if (phPCM)
     1708    {
     1709        snd_pcm_sframes_t cSamplesAvail;
     1710        int rc2 = alsaStreamGetAvail(phPCM, &cSamplesAvail);
    16981711        if (RT_SUCCESS(rc2))
    16991712        {
    1700             LogFlowFunc(("cAvail=%ld\n", cAvail));
    1701             if (cAvail >= (snd_pcm_sframes_t)pStreamOut->cSamplesMin)
    1702                 strmSts |= PDMAUDIOSTRMSTS_FLAG_DATA_WRITABLE;
     1713            Log3Func(("cAvail=%ld \n", cSamplesAvail));
     1714            if (cSamplesAvail >= cSamplesMin)
     1715                strmSts |= pStream->enmDir == PDMAUDIODIR_IN
     1716                         ? PDMAUDIOSTRMSTS_FLAG_DATA_READABLE
     1717                         : PDMAUDIOSTRMSTS_FLAG_DATA_WRITABLE;
    17031718        }
    17041719    }
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