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
04a2138b
Commit
04a2138b
authored
Jan 07, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pcm: pass void pointers to PCM functions
In generic PCM functions allowing all sample formats, pass a void pointer instead of a char pointer.
parent
bb010164
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
11 additions
and
12 deletions
+11
-12
pcm_convert.c
src/pcm_convert.c
+4
-5
pcm_convert.h
src/pcm_convert.h
+2
-2
pcm_mix.c
src/pcm_mix.c
+2
-2
pcm_mix.h
src/pcm_mix.h
+1
-1
pcm_volume.c
src/pcm_volume.c
+1
-1
pcm_volume.h
src/pcm_volume.h
+1
-1
No files found.
src/pcm_convert.c
View file @
04a2138b
...
...
@@ -117,21 +117,20 @@ pcm_convert_24(const struct audio_format *src_format,
return
len
;
}
/* outFormat bits must be 16 and channels must be 1 or 2! */
size_t
pcm_convert
(
const
struct
audio_format
*
inFormat
,
const
char
*
src
,
size_t
src_size
,
const
void
*
src
,
size_t
src_size
,
const
struct
audio_format
*
outFormat
,
char
*
outBuffer
,
void
*
dest
,
struct
pcm_convert_state
*
convState
)
{
switch
(
outFormat
->
bits
)
{
case
16
:
return
pcm_convert_16
(
inFormat
,
src
,
src_size
,
outFormat
,
(
int16_t
*
)
outBuffer
,
outFormat
,
(
int16_t
*
)
dest
,
convState
);
case
24
:
return
pcm_convert_24
(
inFormat
,
src
,
src_size
,
outFormat
,
(
int32_t
*
)
outBuffer
,
outFormat
,
(
int32_t
*
)
dest
,
convState
);
default:
...
...
src/pcm_convert.h
View file @
04a2138b
...
...
@@ -33,9 +33,9 @@ struct pcm_convert_state {
void
pcm_convert_init
(
struct
pcm_convert_state
*
state
);
size_t
pcm_convert
(
const
struct
audio_format
*
inFormat
,
const
char
*
inBuffer
,
size_t
inS
ize
,
const
void
*
src
,
size_t
src_s
ize
,
const
struct
audio_format
*
outFormat
,
char
*
outBuffer
,
void
*
dest
,
struct
pcm_convert_state
*
convState
);
size_t
pcm_convert_size
(
const
struct
audio_format
*
inFormat
,
size_t
inSize
,
...
...
src/pcm_mix.c
View file @
04a2138b
...
...
@@ -80,7 +80,7 @@ pcm_add_24(int32_t *buffer1, const int32_t *buffer2,
}
static
void
pcm_add
(
char
*
buffer1
,
const
char
*
buffer2
,
size_t
size
,
pcm_add
(
void
*
buffer1
,
const
void
*
buffer2
,
size_t
size
,
int
vol1
,
int
vol2
,
const
struct
audio_format
*
format
)
{
...
...
@@ -107,7 +107,7 @@ pcm_add(char *buffer1, const char *buffer2, size_t size,
}
void
pcm_mix
(
char
*
buffer1
,
const
char
*
buffer2
,
size_t
size
,
pcm_mix
(
void
*
buffer1
,
const
void
*
buffer2
,
size_t
size
,
const
struct
audio_format
*
format
,
float
portion1
)
{
int
vol1
;
...
...
src/pcm_mix.h
View file @
04a2138b
...
...
@@ -24,7 +24,7 @@
struct
audio_format
;
void
pcm_mix
(
char
*
buffer1
,
const
char
*
buffer2
,
size_t
size
,
pcm_mix
(
void
*
buffer1
,
const
void
*
buffer2
,
size_t
size
,
const
struct
audio_format
*
format
,
float
portion1
);
#endif
src/pcm_volume.c
View file @
04a2138b
...
...
@@ -74,7 +74,7 @@ pcm_volume_change_24(int32_t *buffer, unsigned num_samples, int volume)
}
void
pcm_volume
(
char
*
buffer
,
int
bufferSize
,
pcm_volume
(
void
*
buffer
,
int
bufferSize
,
const
struct
audio_format
*
format
,
int
volume
)
{
...
...
src/pcm_volume.h
View file @
04a2138b
...
...
@@ -52,7 +52,7 @@ pcm_volume_dither(void)
}
void
pcm_volume
(
char
*
buffer
,
int
bufferSize
,
pcm_volume
(
void
*
buffer
,
int
bufferSize
,
const
struct
audio_format
*
format
,
int
volume
);
...
...
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