VirtualBox

Changeset 82463 in vbox


Ignore:
Timestamp:
Dec 6, 2019 2:29:16 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
135313
Message:

pdmaudioifs.h,Devices/Audio: Corrected the size alignment of PDMAUDIOSTREAMCFG to 8 bytes. bugref:9218

Location:
trunk
Files:
6 edited

Legend:

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

    r82261 r82463  
    627627
    628628/**
    629  * Structure for mapping a single (mono) channel or dual (stereo) channels onto
    630  * an audio stream (aka stream profile).
    631  *
    632  * An audio stream consists of one or multiple channels (e.g. 1 for mono, 2 for
    633  * stereo), depending on the configuration.
     629 * Mappings channels onto an audio stream.
     630 *
     631 * The mappings are either for a single (mono) or dual (stereo) channels onto an
     632 * audio stream (aka stream profile).  An audio stream consists of one or
     633 * multiple channels (e.g. 1 for mono, 2 for stereo), depending on the
     634 * configuration.
    634635 */
    635636typedef struct PDMAUDIOSTREAMMAP
     
    637638    /** Array of channel IDs being handled.
    638639     * @note The first (zero-based) index specifies the leftmost channel. */
    639     PDMAUDIOSTREAMCHANNELID     aID[2];
     640    PDMAUDIOSTREAMCHANNELID     aenmIDs[2];
    640641    /** Step size (in bytes) to the channel's next frame. */
    641642    uint32_t                    cbStep;
     
    701702
    702703/**
    703  * Structure for keeping an audio stream configuration.
     704 * An audio stream configuration.
    704705 */
    705706typedef struct PDMAUDIOSTREAMCFG
     
    751752        uint32_t            cFramesPreBuffering;
    752753    } Backend;
     754    uint32_t                u32Padding;
    753755    /** Friendly name of the stream. */
    754756    char                    szName[64];
    755757} PDMAUDIOSTREAMCFG;
    756 AssertCompileSizeAlignment(PDMAUDIOPCMPROPS, 8);
     758AssertCompileSizeAlignment(PDMAUDIOSTREAMCFG, 8);
    757759/** Pointer to audio stream configuration keeper. */
    758760typedef PDMAUDIOSTREAMCFG *PPDMAUDIOSTREAMCFG;
     
    12001202
    12011203/**
    1202  * Structure for maintaining an input/output audio stream.
     1204 * An input or output audio stream.
    12031205 */
    12041206typedef struct PDMAUDIOSTREAM
     
    12491251
    12501252/**
    1251  * Enumeration for an audio callback source.
     1253 * Audio callback source.
    12521254 */
    12531255typedef enum PDMAUDIOCBSOURCE
    12541256{
    12551257    /** Invalid, do not use. */
    1256     PDMAUDIOCBSOURCE_INVALID    = 0,
     1258    PDMAUDIOCBSOURCE_INVALID = 0,
    12571259    /** Device emulation. */
    12581260    PDMAUDIOCBSOURCE_DEVICE,
  • trunk/src/VBox/Devices/Audio/DevIchAc97.cpp

    r82451 r82463  
    360360#endif
    361361    /** The stream's current configuration. */
    362     PDMAUDIOSTREAMCFG       Cfg; //+104
    363     uint32_t                Padding2;
     362    PDMAUDIOSTREAMCFG       Cfg; //+108
    364363#ifdef VBOX_WITH_AUDIO_AC97_ASYNC_IO
    365364    /** Asynchronous I/O state members. */
  • trunk/src/VBox/Devices/Audio/DrvAudioCommon.cpp

    r82458 r82463  
    951951    AssertPtrReturnVoid(pCfg);
    952952
    953     RT_BZERO(pCfg, sizeof(PDMAUDIOSTREAMCFG));
     953    RT_ZERO(*pCfg);
    954954
    955955    pCfg->Backend.cFramesPreBuffering = UINT32_MAX; /* Explicitly set to "undefined". */
  • trunk/src/VBox/Devices/Audio/DrvHostDSound.cpp

    r82255 r82463  
    114114{
    115115    /** The stream's acquired configuration. */
    116     PDMAUDIOSTREAMCFG  Cfg;
     116    PDMAUDIOSTREAMCFG   Cfg;
    117117    /** Buffer alignment. */
    118     uint8_t            uAlign;
     118    uint8_t             uAlign;
    119119    /** Whether this stream is in an enable state on the DirectSound side. */
    120     bool               fEnabled;
     120    bool                fEnabled;
     121    bool                afPadding[2];
     122    /** Size (in bytes) of the DirectSound buffer.
     123     *  @note This in *not* the size of the circular buffer above! */
     124    DWORD               cbBufSize;
    121125    /** The stream's critical section for synchronizing access. */
    122     RTCRITSECT         CritSect;
     126    RTCRITSECT          CritSect;
    123127    /** The internal playback / capturing buffer. */
    124     PRTCIRCBUF         pCircBuf;
    125     /** Size (in bytes) of the DirectSound buffer.
    126      *  Note: This in *not* the size of the circular buffer above! */
    127     DWORD              cbBufSize;
     128    PRTCIRCBUF          pCircBuf;
    128129    union
    129130    {
  • trunk/src/VBox/Devices/Audio/HDAStream.h

    r82450 r82463  
    166166     *  Should match SDFMT. */
    167167    PDMAUDIOSTREAMCFG       Cfg;
    168     uint32_t                Padding4;
    169168    /** Timestamp (in ns) of last stream update. */
    170169    uint64_t                tsLastUpdateNs;
  • trunk/src/VBox/Devices/Audio/HDAStreamMap.cpp

    r82252 r82463  
    156156        PPDMAUDIOSTREAMMAP pMapLR = &pMap->paMappings[0];
    157157
    158         pMapLR->aID[0]   = PDMAUDIOSTREAMCHANNELID_FRONT_LEFT;
    159         pMapLR->aID[1]   = PDMAUDIOSTREAMCHANNELID_FRONT_RIGHT;
    160         pMapLR->cbFrame  = pProps->cbSample * pProps->cChannels;
    161         pMapLR->cbStep   = pProps->cbSample * 2 /* Front left + Front right channels */;
    162         pMapLR->offFirst = 0;
    163         pMapLR->offNext  = pMapLR->offFirst;
     158        pMapLR->aenmIDs[0]  = PDMAUDIOSTREAMCHANNELID_FRONT_LEFT;
     159        pMapLR->aenmIDs[1]  = PDMAUDIOSTREAMCHANNELID_FRONT_RIGHT;
     160        pMapLR->cbFrame     = pProps->cbSample * pProps->cChannels;
     161        pMapLR->cbStep      = pProps->cbSample * 2 /* Front left + Front right channels */;
     162        pMapLR->offFirst    = 0;
     163        pMapLR->offNext     = pMapLR->offFirst;
    164164
    165165        rc = hdaR3StreamChannelDataInit(&pMapLR->Data, PDMAUDIOSTREAMCHANNELDATA_FLAGS_NONE);
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