Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
timer-linux: fallback to CLOCK_MONOTONIC instead of timespec_get
CLOCK_MONOTONIC_RAW is linux-specific (macOS later supported it but it has its own timer code) and not neccessarily available everywhere like on BSDs. It makes sense to prefer it because mpv does a lot of measurements at small intervals (e.g. every frame) so theoretically it should be more accurate. However if the OS doesn't have it, fallback to CLOCK_MONOTONIC instead which is almost exactly the same and very widely supported across unix-like systems. This clock is technically optional according to POSIX, but any half-decent OS supports it anyway (sorry Solaris users). As a benefit, we now know that the clock from mp_time is always monotonic.
- Loading branch information