diff options
Diffstat (limited to 'src/Utils.h')
-rw-r--r-- | src/Utils.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/Utils.h b/src/Utils.h index 0cf6396..17f3788 100644 --- a/src/Utils.h +++ b/src/Utils.h @@ -21,6 +21,18 @@ namespace SaneAudioRenderer return (size_t)(llMulDiv(time, rate, OneSecond, 0));
}
+ inline int64_t FramesToTime(size_t frames, uint32_t rate)
+ {
+ assert(rate > 0);
+ return llMulDiv(frames, OneSecond, rate, 0);
+ }
+
+ inline int64_t FramesToTimeLong(int64_t frames, uint32_t rate)
+ {
+ assert(rate > 0);
+ return llMulDiv(frames, OneSecond, rate, 0);
+ }
+
inline void ThrowIfFailed(HRESULT result)
{
if (FAILED(result))
|