Don't update video of sources if not displaying
This is a bit of an optimization to reduce load a little bit if any of the video capture sources are not currently being displayed on the screen. They will simply not capture or update their texture data if they are not currently being shown anywhere. The mac and window game capture sources don't really apply due to the fact that their textures aren't updated on the source's end (they update inside of the hooks).
This commit is contained in:
@@ -328,6 +328,8 @@ static void display_capture_video_tick(void *data, float seconds)
|
||||
|
||||
if (!dc->current)
|
||||
return;
|
||||
if (!obs_source_showing(dc->source))
|
||||
return;
|
||||
|
||||
IOSurfaceRef prev_prev = dc->prev;
|
||||
if (pthread_mutex_lock(&dc->mutex))
|
||||
|
@@ -200,6 +200,11 @@ static inline void window_capture_tick_internal(struct window_capture *wc,
|
||||
|
||||
static void window_capture_tick(void *data, float seconds)
|
||||
{
|
||||
struct window_capture *wc = data;
|
||||
|
||||
if (!obs_source_showing(wc->source))
|
||||
return;
|
||||
|
||||
@autoreleasepool {
|
||||
return window_capture_tick_internal(data, seconds);
|
||||
}
|
||||
|
Reference in New Issue
Block a user