From 506e30da108e7255056b6eb9e91a0ff6297a7951 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Sat, 7 Mar 2015 09:03:31 -0800 Subject: [PATCH] libobs: Do not clear frame cache if 0,0 dimension Previously I had it set so that it would set the async_width and async_height variables to 0,0 if a null frame occurs, but the problem with this is that it was inadvertently cause the frame cache to clear when it starts receiving textures again because it detects it as a size change. So instead of changing async_width and async_height to 0 when a null frame occurs, change it so that if the source is set to an inactive state, make obs_source_get_width/_get_height return 0 for their dimensions instead. --- libobs/obs-source.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/libobs/obs-source.c b/libobs/obs-source.c index 7a9b60cd8..4c935ef89 100644 --- a/libobs/obs-source.c +++ b/libobs/obs-source.c @@ -1182,7 +1182,7 @@ static uint32_t get_base_width(const obs_source_t *source) return get_base_width(source->filter_target); } - return source->async_width; + return source->async_active ? source->async_width : 0; } static uint32_t get_base_height(const obs_source_t *source) @@ -1194,7 +1194,7 @@ static uint32_t get_base_height(const obs_source_t *source) return get_base_height(source->filter_target); } - return source->async_height; + return source->async_active ? source->async_height : 0; } static uint32_t get_recurse_width(obs_source_t *source) @@ -1561,8 +1561,6 @@ void obs_source_output_video(obs_source_t *source, source->async_active = true; } else { source->async_active = false; - source->async_width = 0; - source->async_height = 0; } }