Przeglądaj źródła

libobs: Fix PTS incrementation when FPS divisor is enabled

When using a PTS divisor, OBS would still increment the PTS by only the
original `fps_den` value, not considering that PTS values should be
multiplied by the divisor.

For example, `60/1` increases like `0,1,2,3`. `60000/1001` increases
like `0,1001,2002,3003`.

Without this fix, `60/1` main OBS framerate with a divisor of `2`
produces `0,1,2,3`, while the correct pattern would be `0,2,4,6`
tt2468 1 rok temu
rodzic
commit
05d52ee3a7
1 zmienionych plików z 2 dodań i 1 usunięć
  1. 2 1
      libobs/obs-encoder.c

+ 2 - 1
libobs/obs-encoder.c

@@ -1398,7 +1398,8 @@ static void receive_video(void *param, struct video_data *frame)
 	enc_frame.pts = encoder->cur_pts;
 
 	if (do_encode(encoder, &enc_frame))
-		encoder->cur_pts += encoder->timebase_num;
+		encoder->cur_pts +=
+			encoder->timebase_num * encoder->frame_rate_divisor;
 
 wait_for_audio:
 	profile_end(receive_video_name);