Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
c4d3030d
Commit
c4d3030d
authored
Oct 30, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CrossFade: eliminate NaN from mixramp_interpolate()
Use a boolean flag instead.
parent
c6f10188
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
CrossFade.cxx
src/CrossFade.cxx
+4
-4
No files found.
src/CrossFade.cxx
View file @
c4d3030d
...
...
@@ -25,8 +25,6 @@
#include "util/Domain.hxx"
#include "Log.hxx"
#include <cmath>
#include <assert.h>
#include <string.h>
#include <stdlib.h>
...
...
@@ -37,7 +35,8 @@ gcc_pure
static
float
mixramp_interpolate
(
const
char
*
ramp_list
,
float
required_db
)
{
float
last_db
=
nan
(
""
),
last_secs
=
0
;
float
last_db
=
0
,
last_secs
=
0
;
bool
have_last
=
false
;
/* ramp_list is a string of pairs of dBs and seconds that describe the
* volume profile. Delimiters are semi-colons between pairs and spaces
...
...
@@ -71,11 +70,12 @@ mixramp_interpolate(const char *ramp_list, float required_db)
if
(
db
<
required_db
)
{
last_db
=
db
;
last_secs
=
secs
;
have_last
=
true
;
continue
;
}
/* If required db < any stored value, use the least. */
if
(
std
::
isnan
(
last_db
)
)
if
(
!
have_last
)
return
secs
;
/* Finally, interpolate linearly. */
...
...
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