Browse Source

libobs: Set video timing_adjust to obs video time

When an async video frame comes in and it sets the timing_adjust value
(used to sync audio to video based upon their timestamps), it would use
os_gettime_ns as a base.  Instead, it should use OBS' current video
frame time so that the audio and video playback is as accurate as
possible relative to the actual exact timestamp of the video frame.
(Results are almost insignificant, but it's nice to be as precise as
possible)
jp9000 8 năm trước cách đây
mục cha
commit
ef97f15d6b
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      libobs/obs-source.c

+ 1 - 1
libobs/obs-source.c

@@ -1676,7 +1676,7 @@ static void obs_source_update_async_video(obs_source_t *source)
 		source->async_rendered = true;
 		if (frame) {
 			source->timing_adjust =
-				os_gettime_ns() - frame->timestamp;
+				obs->video.video_time - frame->timestamp;
 			source->timing_set = true;
 
 			if (source->async_update_texture) {