Browse Source

libobs: Fix sync bug in new frame handling code

The return value of os_sleepto_ns is true if it waited to the specified
time, and false if the current time is past the specified time.  So it
basically returns true if it successfully waited.

I just didn't check the return value properly here, so it ended up just
setting the count of frames to 1 if overshot, ultimately causing sync
issues.
jp9000 10 years ago
parent
commit
b120f7cc80
1 changed files with 1 additions and 1 deletions
  1. 1 1
      libobs/obs-video.c

+ 1 - 1
libobs/obs-video.c

@@ -486,7 +486,7 @@ static inline void video_sleep(struct obs_core_video *video,
 	uint64_t t = cur_time + interval_ns;
 	int count;
 
-	if (!os_sleepto_ns(t)) {
+	if (os_sleepto_ns(t)) {
 		*p_time = t;
 		count = 1;
 	} else {