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`
This commit is contained in:
tt2468
2023-11-29 16:23:24 +01:00
committed by Rodney
parent e9ecb6c565
commit 05d52ee3a7
+2 -1
View File
@@ -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);