VirtualBox

Ignore:
Timestamp:
Aug 19, 2015 9:39:17 AM (9 years ago)
Author:
vboxsync
Message:

Audio: Try to fix chopped off samples when playing short sound files.

File:
1 edited

Legend:

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

    r57397 r57451  
    214214
    215215    return rc;
     216}
     217
     218/**
     219 * Returns available number of samples for reading.
     220 *
     221 * @return  uint32_t                Number of samples available for reading.
     222 * @param   pMixBuf                 Mixing buffer to return value for.
     223 */
     224uint32_t AudioMixBufAvail(PPDMAUDIOMIXBUF pMixBuf)
     225{
     226    AssertPtrReturn(pMixBuf, true);
     227
     228    uint32_t cAvail;
     229    if (pMixBuf->pParent) /* Child */
     230        cAvail = pMixBuf->cMixed;
     231    else
     232        cAvail = pMixBuf->cProcessed;
     233
     234    Assert(cAvail <= pMixBuf->cSamples);
     235    return cAvail;
    216236}
    217237
     
    932952
    933953/**
    934  * Returns the number of audio samples mixed (processed) from
     954 * Returns the number of audio samples mixed (processed) by
    935955 * the parent mixing buffer.
    936956 *
     
    963983    AssertPtrReturn(pDst, VERR_INVALID_POINTER);
    964984    AssertPtrReturn(pSrc, VERR_INVALID_POINTER);
     985    AssertReturn(cSamples, VERR_INVALID_PARAMETER);
    965986    /* pcProcessed is optional. */
    966987
     
    12641285    AssertPtrReturn(pMixBuf, VERR_INVALID_POINTER);
    12651286    AssertPtrReturn(pvBuf, VERR_INVALID_POINTER);
    1266     AssertReturn(cbBuf, VERR_INVALID_PARAMETER);
    12671287    /* pcbRead is optional. */
    12681288
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