VirtualBox

Changeset 89480 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jun 3, 2021 12:40:59 PM (4 years ago)
Author:
vboxsync
Message:

DrvHostAudioAlsaStubs.h: Another attempt at fixing the pedantic gcc warning/error. bugref:9890

File:
1 edited

Legend:

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

    r89473 r89480  
    508508        unsigned int    padding[1 + PDMAUDIO_MAX_CHANNELS];
    509509    } u;
    510     uint8_t      aidChannels[PDMAUDIO_MAX_CHANNELS];
    511     unsigned int cChannels = u.Map.channels = PDMAudioPropsChannels(&pCfgReq->Props);
    512     unsigned int iDst      = 0;
     510    uint8_t       aidSrcChannels[PDMAUDIO_MAX_CHANNELS];
     511    unsigned int *aidDstChannels = &u.Map.pos[0];
     512    unsigned int  cChannels      = u.Map.channels = PDMAudioPropsChannels(&pCfgReq->Props);
     513    unsigned int  iDst           = 0;
    513514    for (unsigned int iSrc = 0; iSrc < cChannels; iSrc++)
    514515    {
    515         uint8_t const idSrc = pCfgReq->Props.aidChannels[iSrc];
    516         aidChannels[iDst] = idSrc;
    517         u.Map.pos[iDst]  = drvHstAudAlsaPdmChToAlsa((PDMAUDIOCHANNELID)idSrc, cChannels);
     516        uint8_t const idSrc  = pCfgReq->Props.aidChannels[iSrc];
     517        aidSrcChannels[iDst] = idSrc;
     518        aidDstChannels[iDst] = drvHstAudAlsaPdmChToAlsa((PDMAUDIOCHANNELID)idSrc, cChannels);
    518519        iDst++;
    519520    }
     
    521522    for (; iDst < PDMAUDIO_MAX_CHANNELS; iDst++)
    522523    {
    523         aidChannels[iDst] = PDMAUDIOCHANNELID_INVALID;
    524         u.Map.pos[iDst]  = SND_CHMAP_NA;
     524        aidSrcChannels[iDst] = PDMAUDIOCHANNELID_INVALID;
     525        aidDstChannels[iDst] = SND_CHMAP_NA;
    525526    }
    526527
     
    529530                          err);
    530531    if (cChannels == PDMAudioPropsChannels(&pCfgReq->Props))
    531         memcpy(pCfgAcq->Props.aidChannels, aidChannels, sizeof(pCfgAcq->Props.aidChannels));
     532        memcpy(pCfgAcq->Props.aidChannels, aidSrcChannels, sizeof(pCfgAcq->Props.aidChannels));
    532533    else
    533534    {
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