mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-01-24 14:19:11 -05:00
All presentation time stamps are rounded to whole seconds during the conversion from nanoseconds to seconds, because of the immediate cast to `int64_t`. This results in the same presentation time stamp being send to consumers for a whole second. In previews/live streams this isn't super visible as last frame is often assumed to be the newest and the stream is updated. It's more problematic when recording since APIs like Apple's AVFoundation don't allow duplicate presentation time stamps or it can look like frames are produced in huge bursts once per second. In this PR `CMTimeMakeWithSeconds` is used instead of `CMTimeMake` to make sure the conversion is done correctly and simplify the calculation we have to do a little.