Pārlūkot izejas kodu

libobs: Use clamped video time for async timing

When playing back buffered async frames, this reduces the probability
that new frames will be missed/skipped due to jitter in the system
timestamps.

If a buffered async source is playing at the same framerate as the
compositor and there is no jitter in the async source's timestamps, then
the async source will play back perfectly in sync with the compositor
thanks to this change, ensuring that there's no skipped or missed frames
in video playback.
jp9000 10 gadi atpakaļ
vecāks
revīzija
35a35badeb
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      libobs/obs-source.c

+ 1 - 1
libobs/obs-source.c

@@ -782,7 +782,7 @@ void obs_source_video_tick(obs_source_t *source, float seconds)
 	if (!source) return;
 
 	if ((source->info.output_flags & OBS_SOURCE_ASYNC) != 0) {
-		uint64_t sys_time = os_gettime_ns();
+		uint64_t sys_time = obs->video.video_time;
 
 		pthread_mutex_lock(&source->async_mutex);
 		if (source->cur_async_frame) {