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.master
parent
05888fc3aa
commit
df5689d534
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue