VirtualBox

Changeset 88278 in vbox


Ignore:
Timestamp:
Mar 24, 2021 1:54:00 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
143483
Message:

Audio: Build fix and some cleanups. bugref:9890

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/pdmaudioifs.h

    r88269 r88278  
    694694    /** The frame size. */
    695695    uint8_t     cbFrame;
    696     /** Sample width (in bytes). */
    697     uint8_t     cbSampleX : 4;
    698     /** Number of audio channels. */
    699     uint8_t     cChannelsX : 4;
    700696    /** Shift count used with PDMAUDIOPCMPROPS_F2B and PDMAUDIOPCMPROPS_B2F.
    701697     * Depends on number of stream channels and the stream format being used, calc
     
    703699     * @sa   PDMAUDIOSTREAMCFG_B2F, PDMAUDIOSTREAMCFG_F2B */
    704700    uint8_t     cShiftX;
     701    /** Sample width (in bytes). */
     702    RT_GCC_EXTENSION
     703    uint8_t     cbSampleX : 4;
     704    /** Number of audio channels. */
     705    RT_GCC_EXTENSION
     706    uint8_t     cChannelsX : 4;
    705707    /** Signed or unsigned sample. */
    706708    bool        fSigned : 1;
     
    723725/** Initializer for PDMAUDIOPCMPROPS. */
    724726#define PDMAUDIOPCMPROPS_INITIALIZER(a_cbSample, a_fSigned, a_cChannels, a_uHz, a_fSwapEndian) \
    725     { (a_cbSample) * (a_cChannels), a_cbSample, a_cChannels, PDMAUDIOPCMPROPS_MAKE_SHIFT_PARMS(a_cbSample, a_cChannels), \
     727    { (a_cbSample) * (a_cChannels), PDMAUDIOPCMPROPS_MAKE_SHIFT_PARMS(a_cbSample, a_cChannels), a_cbSample, a_cChannels, \
    726728      a_fSigned, a_fSwapEndian, false /*fRaw*/, a_uHz }
    727729/** Calculates the cShift value of given sample bits and audio channels.
  • trunk/src/VBox/Devices/Audio/DrvAudio.cpp

    r88269 r88278  
    16471647     * Do the playing if we decided to play something.
    16481648     */
    1649     int rc = VINF_SUCCESS;
     1649    int rc;
    16501650    if (cFramesToPlay)
    16511651    {
     
    16531653            pThis->pHostDrvAudio->pfnStreamPlayBegin(pThis->pHostDrvAudio, pStream->pvBackend);
    16541654
    1655         /** @todo r=bird: I don't honestly see any difference in interleaved,
    1656          *        non-interrleaved, raw, complicate, or whatever frame format we're
    1657          *        dealing with here.  We'll be formatting a chunk of audio data and feed
    1658          *        it to the backend, the formatting is taken care of by the mixer and
    1659          *        we don't really care about the format anywhere here.
    1660          *
    1661          *        Raw audio is just stereo S64, btw.  Since drvAudioStreamPlayRaw
    1662          *        actually copies the mixer data instead of accessing the internal mixer
    1663          *        buffer directly, there is no advantage to having separate code paths
    1664          *        here.  It only leads to more incomplete crappy code (I find the code
    1665          *        quality quite appaling, given the amount of time spent on it).
    1666          *
    1667          *        What's more, I think the non-interleaved designation here is wrong
    1668          *        anyway.  Non-interleaved means a stereo chunk of 8 frames is
    1669          *        formatted:
    1670          *              - LLLLLLLLRRRRRRRR
    1671          *        whereas I'm pretty darn sure we do:
    1672          *              - LRLRLRLRLRLRLRLR
    1673          *        given that the mixer doesn't know how to output the former.  See the
    1674          *        audioMixBufConvTo##a_Name##Stereo() code, it clearly output LR pairs.
    1675          *
    1676          *        https://stackoverflow.com/questions/17879933/whats-the-interleaved-audio
    1677          */
    16781655        rc = drvAudioStreamPlayDoIt(pThis, pStream, cFramesToPlay, pcFramesPlayed);
    16791656
     
    16831660        pStream->tsLastPlayedCapturedNs = RTTimeNanoTS();
    16841661    }
     1662    else
     1663        rc = VINF_SUCCESS;
    16851664
    16861665    Log3Func(("[%s] Live=%RU32 fr (%RU64 ms) Period=%RU32 fr (%RU64 ms) Writable=%RU32 fr (%RU64 ms) -> ToPlay=%RU32 fr (%RU64 ms) Played=%RU32 fr (%RU64 ms)%s\n",
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