VirtualBox

Changeset 73208 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jul 18, 2018 3:00:47 PM (6 years ago)
Author:
vboxsync
Message:

Audio/DrvAudio: Don't use float / size_t in DrvAudioHlpBytesToMs() and DrvAudioHlpFramesToMs().

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Audio/DrvAudio.h

    r73207 r73208  
    155155uint32_t DrvAudioHlpCalcBitrate(const PPDMAUDIOPCMPROPS pProps);
    156156uint32_t DrvAudioHlpBytesToFrames(const PPDMAUDIOPCMPROPS pProps, uint32_t cbBytes);
    157 uint64_t DrvAudioHlpBytesToMs(const PPDMAUDIOPCMPROPS pProps, size_t cbBytes);
     157uint64_t DrvAudioHlpBytesToMs(const PPDMAUDIOPCMPROPS pProps, uint32_t cbBytes);
    158158uint32_t DrvAudioHlpFramesToBytes(const PPDMAUDIOPCMPROPS pProps, uint32_t cFrames);
    159 float DrvAudioHlpFramesToMs(const PPDMAUDIOPCMPROPS pProps, size_t cFrames);
     159uint64_t DrvAudioHlpFramesToMs(const PPDMAUDIOPCMPROPS pProps, uint32_t cFrames);
    160160uint32_t DrvAudioHlpMsToBytes(const PPDMAUDIOPCMPROPS pProps, uint32_t uMs);
    161161uint32_t DrvAudioHlpMsToFrames(const PPDMAUDIOPCMPROPS pProps, uint32_t uMs);
  • trunk/src/VBox/Devices/Audio/DrvAudioCommon.cpp

    r73207 r73208  
    10841084 * @param   cbBytes             Amount of bytes to calculate time for.
    10851085 */
    1086 uint64_t DrvAudioHlpBytesToMs(const PPDMAUDIOPCMPROPS pProps, size_t cbBytes)
     1086uint64_t DrvAudioHlpBytesToMs(const PPDMAUDIOPCMPROPS pProps, uint32_t cbBytes)
    10871087{
    10881088    AssertPtrReturn(pProps, 0);
     
    11191119 * Returns the time (in ms) for given audio frames amount and PCM properties.
    11201120 *
    1121  * @return  float               Calculated time (in ms).
     1121 * @return  uint64_t            Calculated time (in ms).
    11221122 * @param   pProps              PCM properties to calculate time (in ms) for.
    11231123 * @param   cFrames             Amount of audio frames to calculate time for.
    11241124 */
    1125 float DrvAudioHlpFramesToMs(const PPDMAUDIOPCMPROPS pProps, size_t cFrames)
     1125uint64_t DrvAudioHlpFramesToMs(const PPDMAUDIOPCMPROPS pProps, uint32_t cFrames)
    11261126{
    11271127    AssertPtrReturn(pProps, 0);
     
    11331133        return 0;
    11341134
    1135     return float(cFrames / (pProps->uHz / 1000 /* ms */));
     1135    return cFrames / (pProps->uHz / 1000 /* ms */);
    11361136}
    11371137
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