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.
This commit is contained in:
parent
26206f6af4
commit
506e30da10
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user