VirtualBox

Changeset 69723 in vbox for trunk


Ignore:
Timestamp:
Nov 17, 2017 11:23:49 AM (7 years ago)
Author:
vboxsync
Message:

Audio/HDA: Added return code for hdaStreamPeriodInit() and return if no valid parameters are given.

Location:
trunk/src/VBox/Devices/Audio
Files:
2 edited

Legend:

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

    r69119 r69723  
    7777 * Initializes a given stream period with needed parameters.
    7878 *
     79 * @return  VBox status code.
    7980 * @param   pPeriod             Stream period to (re-)initialize. Must be created with hdaStreamPeriodCreate() first.
    8081 * @param   u8SD                Stream descriptor (serial data #) number to assign this stream period to.
     
    8384 * @param   pStreamCfg          Audio stream configuration to use for this period.
    8485 */
    85 void hdaStreamPeriodInit(PHDASTREAMPERIOD pPeriod,
    86                          uint8_t u8SD, uint16_t u16LVI, uint32_t u32CBL, PPDMAUDIOSTREAMCFG pStreamCfg)
    87 {
    88 
    89     /* Sanity. */
    90     AssertReturnVoid(u16LVI);
    91     AssertReturnVoid(u32CBL);
    92     AssertReturnVoid(DrvAudioHlpStreamCfgIsValid(pStreamCfg));
     86int hdaStreamPeriodInit(PHDASTREAMPERIOD pPeriod,
     87                        uint8_t u8SD, uint16_t u16LVI, uint32_t u32CBL, PPDMAUDIOSTREAMCFG pStreamCfg)
     88{
     89    if (   !u16LVI
     90        || !u32CBL
     91        || !DrvAudioHlpStreamCfgIsValid(pStreamCfg))
     92    {
     93        return VERR_INVALID_PARAMETER;
     94    }
    9395
    9496    /*
     
    119121              pPeriod->u8SD, pPeriod->u64DurationWalClk, pPeriod->u32Hz, u32CBL, u16LVI,
    120122              cTotalPeriods, pPeriod->framesToTransfer));
     123
     124    return VINF_SUCCESS;
    121125}
    122126
  • trunk/src/VBox/Devices/Audio/HDAStreamPeriod.h

    r69119 r69723  
    8585int      hdaStreamPeriodCreate(PHDASTREAMPERIOD pPeriod);
    8686void     hdaStreamPeriodDestroy(PHDASTREAMPERIOD pPeriod);
    87 void     hdaStreamPeriodInit(PHDASTREAMPERIOD pPeriod, uint8_t u8SD, uint16_t u16LVI, uint32_t u32CBL, PPDMAUDIOSTREAMCFG pStreamCfg);
     87int      hdaStreamPeriodInit(PHDASTREAMPERIOD pPeriod, uint8_t u8SD, uint16_t u16LVI, uint32_t u32CBL, PPDMAUDIOSTREAMCFG pStreamCfg);
    8888void     hdaStreamPeriodReset(PHDASTREAMPERIOD pPeriod);
    8989int      hdaStreamPeriodBegin(PHDASTREAMPERIOD pPeriod, uint64_t u64WalClk);
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