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
a65f6374
Commit
a65f6374
authored
Oct 30, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CrossFade: use negative value for invalid mixramp_delay
Avoid NaN to allow -ffast-math.
parent
a21edddf
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
6 deletions
+5
-6
CrossFade.cxx
src/CrossFade.cxx
+1
-1
CrossFade.hxx
src/CrossFade.hxx
+3
-4
PlayerThread.cxx
src/PlayerThread.cxx
+1
-1
No files found.
src/CrossFade.cxx
View file @
a65f6374
...
@@ -108,7 +108,7 @@ CrossFadeSettings::Calculate(float total_time,
...
@@ -108,7 +108,7 @@ CrossFadeSettings::Calculate(float total_time,
chunks_f
=
(
float
)
af
.
GetTimeToSize
()
/
(
float
)
CHUNK_SIZE
;
chunks_f
=
(
float
)
af
.
GetTimeToSize
()
/
(
float
)
CHUNK_SIZE
;
if
(
std
::
isnan
(
mixramp_delay
)
||
!
mixramp_start
||
!
mixramp_prev_end
)
{
if
(
mixramp_delay
<=
0
||
!
mixramp_start
||
!
mixramp_prev_end
)
{
chunks
=
(
chunks_f
*
duration
+
0.5
);
chunks
=
(
chunks_f
*
duration
+
0.5
);
}
else
{
}
else
{
/* Calculate mixramp overlap. */
/* Calculate mixramp overlap. */
...
...
src/CrossFade.hxx
View file @
a65f6374
...
@@ -22,8 +22,6 @@
...
@@ -22,8 +22,6 @@
#include "Compiler.h"
#include "Compiler.h"
#include <cmath>
struct
AudioFormat
;
struct
AudioFormat
;
struct
CrossFadeSettings
{
struct
CrossFadeSettings
{
...
@@ -35,14 +33,15 @@ struct CrossFadeSettings {
...
@@ -35,14 +33,15 @@ struct CrossFadeSettings {
float
mixramp_db
;
float
mixramp_db
;
/**
/**
* The configured MixRapm delay [s].
* The configured MixRapm delay [s]. A non-positive value
* disables MixRamp.
*/
*/
float
mixramp_delay
;
float
mixramp_delay
;
CrossFadeSettings
()
CrossFadeSettings
()
:
duration
(
0
),
:
duration
(
0
),
mixramp_db
(
0
),
mixramp_db
(
0
),
mixramp_delay
(
std
::
nanf
(
""
)
)
mixramp_delay
(
-
1
)
{}
{}
...
...
src/PlayerThread.cxx
View file @
a65f6374
...
@@ -779,7 +779,7 @@ Player::PlayNextChunk()
...
@@ -779,7 +779,7 @@ Player::PlayNextChunk()
other_chunk
->
tag
);
other_chunk
->
tag
);
other_chunk
->
tag
=
nullptr
;
other_chunk
->
tag
=
nullptr
;
if
(
std
::
isnan
(
pc
.
cross_fade
.
mixramp_delay
)
)
{
if
(
pc
.
cross_fade
.
mixramp_delay
<=
0
)
{
chunk
->
mix_ratio
=
((
float
)
cross_fade_position
)
chunk
->
mix_ratio
=
((
float
)
cross_fade_position
)
/
cross_fade_chunks
;
/
cross_fade_chunks
;
}
else
{
}
else
{
...
...
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