Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Kiesow <lkiesow@uos.de>2014-01-25 18:00:02 +0400
committerLars Kiesow <lkiesow@uos.de>2014-01-25 18:00:02 +0400
commite395f8de5ac682d8c99673d431ad7c0575bf2a7e (patch)
tree5cd95fa99e572785f6fad03b91b2eda52ed51d25 /libavfilter/vf_scale.c
parent7fc4c184630043587ace5b44ef70ccf70c7409fe (diff)
Fixed factor for scale filter
Diffstat (limited to 'libavfilter/vf_scale.c')
-rw-r--r--libavfilter/vf_scale.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c
index bda536df91..2ea55ef441 100644
--- a/libavfilter/vf_scale.c
+++ b/libavfilter/vf_scale.c
@@ -236,6 +236,7 @@ static int config_props(AVFilterLink *outlink)
double var_values[VARS_NB], res;
char *expr;
int ret;
+ int factor_w, factor_h;
var_values[VAR_IN_W] = var_values[VAR_IW] = inlink->w;
var_values[VAR_IN_H] = var_values[VAR_IH] = inlink->h;
@@ -273,15 +274,17 @@ static int config_props(AVFilterLink *outlink)
/* Check if it is requested that the result has to be divisible by a some
* factor (w or h = -n with n being the factor). After we got the factor,
* we set w/h back to -1 so that the automatic scaling is done. */
- int factor_w = 1;
- int factor_h = 1;
+ factor_w = 1;
+ factor_h = 1;
if (w < -1) {
factor_w = -w;
w = -1;
+ scale->w = -1;
}
if (h < -1) {
factor_h = -h;
h = -1;
+ scale->h = -1;
}
if (w == -1 && h == -1)
@@ -302,7 +305,6 @@ static int config_props(AVFilterLink *outlink)
w = (w / factor_w) * factor_w;
h = (h / factor_h) * factor_h;
-
/* Note that force_original_aspect_ratio may overwrite the previous set
* dimensions so that it is not divisible by the set factors anymore. */
if (scale->force_original_aspect_ratio) {