提交 79981889 编写于 作者: R Richard Stanway

obs-filters: Misc code cleanups detected by PVS Studio

上级 ea7bb7a7
......@@ -410,8 +410,7 @@ static void compressor_tick(void *data, float seconds)
if (new_name) {
obs_source_t *sidechain =
new_name && *new_name ? obs_get_source_by_name(new_name)
: NULL;
*new_name ? obs_get_source_by_name(new_name) : NULL;
obs_weak_source_t *weak_sidechain =
sidechain ? obs_source_get_weak_source(sidechain)
: NULL;
......
......@@ -160,12 +160,12 @@ static void calc_crop_dimensions(struct crop_filter_data *filter,
if (filter->height < 1)
filter->height = 1;
if (width && filter->width) {
if (width) {
mul_val->x = (float)filter->width / (float)width;
add_val->x = (float)filter->left / (float)width;
}
if (height && filter->height) {
if (height) {
mul_val->y = (float)filter->height / (float)height;
add_val->y = (float)filter->top / (float)height;
}
......
......@@ -195,9 +195,7 @@ static void scale_filter_tick(void *data, float seconds)
} else {
if (new_aspect > old_aspect) {
filter->cx_out = (int)(cy_f * new_aspect);
filter->cy_out = cy;
} else {
filter->cx_out = cx;
filter->cy_out = (int)(cx_f / new_aspect);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册