obs-filters: Misc code cleanups detected by PVS Studio
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user