aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/vf_scale.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-01-25 16:54:24 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-01-25 16:54:24 +0100
commit214a3b8bf939c3c5dacfeafb77750fe3ce751b93 (patch)
tree7e508ef463a8ca7ecf48543a88854c32aa9ce32d /libavfilter/vf_scale.c
parent1e48c39ece3ec790dad9a0e308ebe1a77b2f08ba (diff)
downloadandroid_external_ffmpeg-214a3b8bf939c3c5dacfeafb77750fe3ce751b93.tar.gz
android_external_ffmpeg-214a3b8bf939c3c5dacfeafb77750fe3ce751b93.tar.bz2
android_external_ffmpeg-214a3b8bf939c3c5dacfeafb77750fe3ce751b93.zip
avfilter/vf_scale: simplify alignment code
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter/vf_scale.c')
-rw-r--r--libavfilter/vf_scale.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c
index bb5cd39a78..6b7d474aff 100644
--- a/libavfilter/vf_scale.c
+++ b/libavfilter/vf_scale.c
@@ -273,22 +273,17 @@ static int config_props(AVFilterLink *outlink)
h = scale->h;
/* 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. */
+ * factor (w or h = -n with n being the factor). */
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)
+ if (w < 0 && h < 0)
scale->w = scale->h = 0;
if (!(w = scale->w))
@@ -299,9 +294,9 @@ static int config_props(AVFilterLink *outlink)
/* Make sure that the result is divisible by the factor we determined
* earlier. If no factor was set, it is nothing will happen as the default
* factor is 1 */
- if (w == -1)
+ if (w < 0)
w = av_rescale(h, inlink->w, inlink->h * factor_w) * factor_w;
- if (h == -1)
+ if (h < 0)
h = av_rescale(w, inlink->h, inlink->w * factor_h) * factor_h;
/* Note that force_original_aspect_ratio may overwrite the previous set