VirtualBox

Changeset 88136 in vbox for trunk/include/VBox/vmm


Ignore:
Timestamp:
Mar 16, 2021 12:17:42 PM (4 years ago)
Author:
vboxsync
Message:

PDM/audio: Added PDMAudioPropsRoundUpBytesToFrame. bugref:9890

File:
1 edited

Legend:

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

    r88057 r88136  
    493493
    494494/**
     495 * Rounds up the given byte amount to the nearest frame boundrary.
     496 *
     497 * @returns Rounded byte amount.
     498 * @param   pProps      PCM properties to use.
     499 * @param   cb          The size (in bytes) to round.
     500 */
     501DECLINLINE(uint32_t) PDMAudioPropsRoundUpBytesToFrame(PCPDMAUDIOPCMPROPS pProps, uint32_t cb)
     502{
     503    AssertPtrReturn(pProps, 0);
     504    uint32_t const cbFrame = PDMAUDIOPCMPROPS_F2B(pProps, 1 /* Frame */);
     505    AssertReturn(cbFrame, 0);
     506    return PDMAUDIOPCMPROPS_F2B(pProps, PDMAUDIOPCMPROPS_B2F(pProps, cb + cbFrame - 1));
     507}
     508
     509/**
    495510 * Checks if the given size is aligned on a frame boundrary.
    496511 *
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