decoder/Client: use std::chrono::duration<double> instead of raw double

This commit is contained in:
Max Kellermann
2018-09-21 19:37:56 +02:00
parent d1bcd98f79
commit 90f4e97751
10 changed files with 21 additions and 20 deletions

View File

@@ -40,13 +40,13 @@ extern "C" {
* Convert a FFmpeg time stamp to a floating point value (in seconds).
*/
gcc_const
static inline double
static inline FloatDuration
FfmpegTimeToDouble(int64_t t, const AVRational time_base) noexcept
{
assert(t != (int64_t)AV_NOPTS_VALUE);
return (double)av_rescale_q(t, time_base, (AVRational){1, 1024})
/ (double)1024;
return FloatDuration(av_rescale_q(t, time_base, (AVRational){1, 1024}))
/ 1024;
}
/**