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
887d74c4
Commit
887d74c4
authored
May 25, 2013
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
av_d2q: Add a special case for |value| > MAX and |value| < 1/MAX
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
f77467a1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
1 deletion
+3
-1
rational.c
libavutil/rational.c
+2
-0
parseutils
tests/ref/fate/parseutils
+1
-1
No files found.
libavutil/rational.c
View file @
887d74c4
...
...
@@ -115,6 +115,8 @@ AVRational av_d2q(double d, int max)
exponent
=
FFMAX
(
(
int
)(
log
(
fabs
(
d
)
+
1e-20
)
/
LOG2
),
0
);
den
=
1LL
<<
(
61
-
exponent
);
av_reduce
(
&
a
.
num
,
&
a
.
den
,
rint
(
d
*
den
),
den
,
max
);
if
((
!
a
.
num
||
!
a
.
den
)
&&
d
&&
max
>
0
&&
max
<
INT_MAX
)
av_reduce
(
&
a
.
num
,
&
a
.
den
,
llrint
(
d
*
den
),
den
,
INT_MAX
);
return
a
;
}
...
...
tests/ref/fate/parseutils
View file @
887d74c4
...
...
@@ -21,7 +21,7 @@ Testing av_parse_video_rate()
'.23' -> 23/100 OK
'-.23' -> -23/100 ERROR
'-0.234' -> -117/500 ERROR
'-0.0000001' ->
0/1
ERROR
'-0.0000001' ->
-1/10000000
ERROR
' 21332.2324 ' -> 917286/43 OK
' -21332.2324 ' -> -917286/43 ERROR
...
...
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