mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-09-24 23:31:36 +08:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user