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
300f9362
Commit
300f9362
authored
Nov 19, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pcm_mix: implemented 32 bit support
parent
13584280
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
1 deletion
+24
-1
NEWS
NEWS
+1
-1
pcm_mix.c
src/pcm_mix.c
+23
-0
No files found.
NEWS
View file @
300f9362
...
...
@@ -71,7 +71,7 @@ ver 0.16 (20??/??/??)
* database: eliminated maximum line length
* log: redirect stdout/stderr to /dev/null if syslog is used
* set the close-on-exec flag on all file descriptors
* pcm_volume: implemented 32 bit support
* pcm_volume
, pcm_mix
: implemented 32 bit support
* obey $(sysconfdir) for default mpd.conf location
* build with large file support by default
* require GLib 2.12
...
...
src/pcm_mix.c
View file @
300f9362
...
...
@@ -82,6 +82,23 @@ pcm_add_24(int32_t *buffer1, const int32_t *buffer2,
}
static
void
pcm_add_32
(
int32_t
*
buffer1
,
const
int32_t
*
buffer2
,
unsigned
num_samples
,
unsigned
volume1
,
unsigned
volume2
)
{
while
(
num_samples
>
0
)
{
int64_t
sample1
=
*
buffer1
;
int64_t
sample2
=
*
buffer2
++
;
sample1
=
((
sample1
*
volume1
+
sample2
*
volume2
)
+
pcm_volume_dither
()
+
PCM_VOLUME_1
/
2
)
/
PCM_VOLUME_1
;
*
buffer1
++
=
pcm_range_64
(
sample1
,
32
);
--
num_samples
;
}
}
static
void
pcm_add
(
void
*
buffer1
,
const
void
*
buffer2
,
size_t
size
,
int
vol1
,
int
vol2
,
const
struct
audio_format
*
format
)
...
...
@@ -103,6 +120,12 @@ pcm_add(void *buffer1, const void *buffer2, size_t size,
size
/
4
,
vol1
,
vol2
);
break
;
case
32
:
pcm_add_32
((
int32_t
*
)
buffer1
,
(
const
int32_t
*
)
buffer2
,
size
/
4
,
vol1
,
vol2
);
break
;
default:
g_error
(
"%u bits not supported by pcm_add!
\n
"
,
format
->
bits
);
}
...
...
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