VirtualBox

Changeset 87299 in vbox for trunk/src


Ignore:
Timestamp:
Jan 18, 2021 2:06:59 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
142258
Message:

Audio/ALSA: Resolved a @todo (Initialize fSwapEndian in alsaALSAToAudioProps()).

File:
1 edited

Legend:

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

    r82968 r87299  
    161161static int alsaALSAToAudioProps(snd_pcm_format_t fmt, PPDMAUDIOPCMPROPS pProps)
    162162{
    163     /** @todo r=bird: Why isn't this code setting fSwapEndian for every case? It
    164      *        seems to make some UNDOCUMENT ASSUMPTIONS about pProps. */
    165163    switch (fmt)
    166164    {
     
    168166            pProps->cbSample    = 1;
    169167            pProps->fSigned     = true;
     168            pProps->fSwapEndian = false;
    170169            break;
    171170
     
    173172            pProps->cbSample    = 1;
    174173            pProps->fSigned     = false;
     174            pProps->fSwapEndian = false;
    175175            break;
    176176
     
    178178            pProps->cbSample    = 2;
    179179            pProps->fSigned     = true;
     180            pProps->fSwapEndian = false;
    180181            break;
    181182
     
    183184            pProps->cbSample    = 2;
    184185            pProps->fSigned     = false;
     186            pProps->fSwapEndian = false;
    185187            break;
    186188
     
    204206            pProps->cbSample    = 4;
    205207            pProps->fSigned     = true;
     208            pProps->fSwapEndian = false;
    206209            break;
    207210
     
    209212            pProps->cbSample    = 4;
    210213            pProps->fSigned     = false;
     214            pProps->fSwapEndian = false;
    211215            break;
    212216
     
    231235    }
    232236
    233     Assert(pProps->cbSample > 0);
    234     Assert(pProps->cChannels > 0);
     237    AssertReturn(pProps->cbSample > 0,  VERR_NOT_SUPPORTED);
     238    AssertReturn(pProps->cChannels > 0, VERR_INVALID_PARAMETER);
     239
    235240    pProps->cShift = PDMAUDIOPCMPROPS_MAKE_SHIFT_PARMS(pProps->cbSample, pProps->cChannels);
    236241
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