timer: teach it about nanoseconds

Those changes will alow to change vsync base to more precise time base.
In general there is no reason to truncate values returned by system.
This commit is contained in:
Kacper Michajłow
2023-09-10 02:09:28 +02:00
committed by Dudemanguy
parent 40e0fea6eb
commit 9606c3fca9
6 changed files with 57 additions and 36 deletions

View File

@@ -372,7 +372,7 @@ static uint32_t AudioTrack_getPlaybackHeadPosition(struct ao *ao)
return 0;
JNIEnv *env = MP_JNI_GET_ENV(ao);
uint32_t pos = 0;
int64_t now = mp_raw_time_us() * 1000;
int64_t now = mp_raw_time_ns();
int state = MP_JNI_CALL_INT(p->audiotrack, AudioTrack.getPlayState);
int stable_count = 20;