diff options
author | Chris Robinson <[email protected]> | 2018-01-11 22:42:25 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-01-11 22:42:25 -0800 |
commit | 1f236d8f204c66a5c0a1885b6893d6cb8b0c289d (patch) | |
tree | 0731a2bc5d154352e57507dfba5383fd016a81c8 /Alc/backends/mmdevapi.c | |
parent | 370817ba604954418b1d0e03daa11b1d55614e2e (diff) |
Define a function where it's used
Diffstat (limited to 'Alc/backends/mmdevapi.c')
-rw-r--r-- | Alc/backends/mmdevapi.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Alc/backends/mmdevapi.c b/Alc/backends/mmdevapi.c index ecd7eb5d..9604d0f9 100644 --- a/Alc/backends/mmdevapi.c +++ b/Alc/backends/mmdevapi.c @@ -71,6 +71,13 @@ DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_GUID, 0x1da5d803, 0xd492, 0x4edd, 0x8c, 0x #define DEVNAME_HEAD "OpenAL Soft on " +/* Scales the given value using 64-bit integer math, ceiling the result. */ +static inline ALuint64 ScaleCeil(ALuint64 val, ALuint64 new_scale, ALuint64 old_scale) +{ + return (val*new_scale + old_scale-1) / old_scale; +} + + typedef struct { al_string name; al_string endpoint_guid; // obtained from PKEY_AudioEndpoint_GUID , set to "Unknown device GUID" if absent. |