Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
VideoLAN
x264
Commits
59e7ded8
Commit
59e7ded8
authored
Jul 27, 2015
by
Henrik Gramner
Browse files
param_parse: Fix framerate rounding issues
parent
73ae2d11
Changes
1
Hide whitespace changes
Inline
Side-by-side
common/common.c
View file @
59e7ded8
...
...
@@ -703,14 +703,12 @@ int x264_param_parse( x264_param_t *p, const char *name, const char *value )
}
OPT
(
"fps"
)
{
if
(
sscanf
(
value
,
"%u/%u"
,
&
p
->
i_fps_num
,
&
p
->
i_fps_den
)
==
2
)
;
else
if
(
sscanf
(
value
,
"%u/%u"
,
&
p
->
i_fps_num
,
&
p
->
i_fps_den
)
!=
2
)
{
float
fps
=
atof
(
value
);
if
(
fps
>
0
&&
fps
<=
INT_MAX
/
1000
)
double
fps
=
atof
(
value
);
if
(
fps
>
0
.
0
&&
fps
<=
INT_MAX
/
1000
.
0
)
{
p
->
i_fps_num
=
(
int
)(
fps
*
1000
+
.
5
);
p
->
i_fps_num
=
(
int
)(
fps
*
1000
.
0
+
.
5
);
p
->
i_fps_den
=
1000
;
}
else
...
...
Write
Preview
Supports
Markdown
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