0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 04:42:18 +02:00

libobs: Give a little extra time for pause to start/stop

Audio latency can get really low, and if it's low enough, the timestamp
can be passed by the audio subsystem before it's had a chance to pause
with it.  So instead, make the pause have a little bit of extra delay to
ensure that doesn't occur.
This commit is contained in:
jp9000 2019-08-31 00:52:36 -07:00
parent 05888fc3aa
commit df5689d534

View File

@ -541,10 +541,11 @@ static inline void end_pause(struct pause_data *pause, uint64_t ts)
static inline uint64_t get_closest_v_ts(struct pause_data *pause)
{
uint64_t interval = obs->video.video_frame_interval_ns;
uint64_t i2 = interval * 2;
uint64_t ts = os_gettime_ns();
return pause->last_video_ts +
((ts - pause->last_video_ts + interval) / interval) * interval;
((ts - pause->last_video_ts + i2) / interval) * interval;
}
static bool obs_encoded_output_pause(obs_output_t *output, bool pause)