VirtualBox

Ignore:
Timestamp:
May 12, 2022 1:57:54 PM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
151418
Message:

Audio: Resolved @todos regarding PDMAudioPropsAreValid() / AudioHlpPcmPropsAreValid():

  • Renamed AudioHlpPcmPropsAreValid() -> AudioHlpPcmPropsAreValidAndSupported().
  • Don't assert when not supported or invalid (i.e. not set) but just return false. The caller now is responsible for asserting now, if needed.
  • Also added unsigned samples support to AudioHlpPcmPropsAreValidAndSupported().
File:
1 edited

Legend:

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

    r93944 r94993  
    7878    RTTESTI_CHECK(PDMAudioPropsGetBitrate(&Cfg441StereoU32) == 44100*8*8);
    7979
    80     RTTESTI_CHECK(AudioHlpPcmPropsAreValid(&Cfg441StereoS16));
    81     RTTESTI_CHECK(AudioHlpPcmPropsAreValid(&Cfg441StereoU16) == false); /* go figure */
    82     RTTESTI_CHECK(AudioHlpPcmPropsAreValid(&Cfg441StereoU32) == false); /* go figure */
     80    RTTESTI_CHECK(AudioHlpPcmPropsAreValidAndSupported(&Cfg441StereoS16));
     81    RTTESTI_CHECK(AudioHlpPcmPropsAreValidAndSupported(&Cfg441StereoU16) == false); /* go figure */
     82    RTTESTI_CHECK(AudioHlpPcmPropsAreValidAndSupported(&Cfg441StereoU32) == false); /* go figure */
    8383
    8484
     
    210210    );
    211211
    212     RTTESTI_CHECK(AudioHlpPcmPropsAreValid(&config));
     212    RTTESTI_CHECK(AudioHlpPcmPropsAreValidAndSupported(&config));
    213213
    214214    uint32_t cBufSize = _1K;
     
    658658    uint32_t const         cFrames = RTRandU32Ex(16, RT_ELEMENTS(aSrcFrames));
    659659    PDMAUDIOPCMPROPS const CfgSrc  = PDMAUDIOPCMPROPS_INITIALIZER(2 /*cbSample*/, true /*fSigned*/, 2 /*ch*/, uFromHz, false /*fSwap*/);
    660     RTTESTI_CHECK(AudioHlpPcmPropsAreValid(&CfgSrc));
     660    RTTESTI_CHECK(AudioHlpPcmPropsAreValidAndSupported(&CfgSrc));
    661661    AUDIOMIXBUF MixBuf;
    662662    RTTESTI_CHECK_RC_OK_RETV(AudioMixBufInit(&MixBuf, "NewPeekMixBuf", &CfgSrc, cFrames));
     
    668668    /* Peek state (destination) is uToHz 2ch S16 */
    669669    PDMAUDIOPCMPROPS const CfgDst = PDMAUDIOPCMPROPS_INITIALIZER(2 /*cbSample*/, true /*fSigned*/, 2 /*ch*/, uToHz, false /*fSwap*/);
    670     RTTESTI_CHECK(AudioHlpPcmPropsAreValid(&CfgDst));
     670    RTTESTI_CHECK(AudioHlpPcmPropsAreValidAndSupported(&CfgDst));
    671671    AUDIOMIXBUFPEEKSTATE PeekState;
    672672    RTTESTI_CHECK_RC_OK_RETV(AudioMixBufInitPeekState(&MixBuf, &PeekState, &CfgDst));
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