Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
214a3b8b
Commit
214a3b8b
authored
Jan 25, 2014
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/vf_scale: simplify alignment code
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
1e48c39e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
9 deletions
+4
-9
vf_scale.c
libavfilter/vf_scale.c
+4
-9
No files found.
libavfilter/vf_scale.c
View file @
214a3b8b
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment