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
0debe9bd
Commit
0debe9bd
authored
Oct 19, 2011
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pcm_utils: add function pcm_end_pointer()
parent
f1da118a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-1
pcm_format.c
src/pcm_format.c
+2
-1
pcm_utils.h
src/pcm_utils.h
+11
-0
No files found.
src/pcm_format.c
View file @
0debe9bd
...
...
@@ -22,6 +22,7 @@
#include "pcm_dither.h"
#include "pcm_buffer.h"
#include "pcm_pack.h"
#include "pcm_utils.h"
static
void
pcm_convert_8_to_16
(
int16_t
*
out
,
const
int8_t
*
in
,
...
...
@@ -61,7 +62,7 @@ pcm_convert_to_16(struct pcm_buffer *buffer, struct pcm_dither *dither,
enum
sample_format
src_format
,
const
void
*
src
,
size_t
src_size
,
size_t
*
dest_size_r
)
{
const
void
*
src_end
=
(
const
char
*
)
src
+
src_size
;
const
void
*
src_end
=
pcm_end_pointer
(
src
,
src_size
)
;
unsigned
num_samples
;
int16_t
*
dest
;
int32_t
*
dest32
;
...
...
src/pcm_utils.h
View file @
0debe9bd
...
...
@@ -25,6 +25,17 @@
#include <stdint.h>
/**
* Add a byte count to the specified pointer. This is a utility
* function to convert a source pointer and a byte count to an "end"
* pointer for use in loops.
*/
static
inline
const
void
*
pcm_end_pointer
(
const
void
*
p
,
size_t
size
)
{
return
(
const
char
*
)
p
+
size
;
}
/**
* Check if the value is within the range of the provided bit size,
* and caps it if necessary.
*/
...
...
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