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
3b565b5f
Commit
3b565b5f
authored
Mar 01, 2012
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pcm_convert: add method _reset()
Resets the libsamplerate state. Not being used yet.
parent
07429761
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
39 additions
and
0 deletions
+39
-0
pcm_convert.c
src/pcm_convert.c
+6
-0
pcm_convert.h
src/pcm_convert.h
+7
-0
pcm_resample.c
src/pcm_resample.c
+10
-0
pcm_resample.h
src/pcm_resample.h
+6
-0
pcm_resample_internal.h
src/pcm_resample_internal.h
+3
-0
pcm_resample_libsamplerate.c
src/pcm_resample_libsamplerate.c
+7
-0
No files found.
src/pcm_convert.c
View file @
3b565b5f
...
...
@@ -57,6 +57,12 @@ void pcm_convert_deinit(struct pcm_convert_state *state)
pcm_buffer_deinit
(
&
state
->
byteswap_buffer
);
}
void
pcm_convert_reset
(
struct
pcm_convert_state
*
state
)
{
pcm_resample_reset
(
&
state
->
resample
);
}
static
const
void
*
pcm_convert_channels
(
struct
pcm_buffer
*
buffer
,
enum
sample_format
format
,
uint8_t
dest_channels
,
...
...
src/pcm_convert.h
View file @
3b565b5f
...
...
@@ -67,6 +67,13 @@ void pcm_convert_init(struct pcm_convert_state *state);
void
pcm_convert_deinit
(
struct
pcm_convert_state
*
state
);
/**
* Reset the pcm_convert_state object. Use this at the boundary
* between two distinct songs and each time the format changes.
*/
void
pcm_convert_reset
(
struct
pcm_convert_state
*
state
);
/**
* Converts PCM data between two audio formats.
*
* @param state an initialized pcm_convert_state object
...
...
src/pcm_resample.c
View file @
3b565b5f
...
...
@@ -76,6 +76,16 @@ void pcm_resample_deinit(struct pcm_resample_state *state)
pcm_resample_fallback_deinit
(
state
);
}
void
pcm_resample_reset
(
struct
pcm_resample_state
*
state
)
{
#ifdef HAVE_LIBSAMPLERATE
pcm_resample_lsr_reset
(
state
);
#else
(
void
)
state
;
#endif
}
const
float
*
pcm_resample_float
(
struct
pcm_resample_state
*
state
,
unsigned
channels
,
...
...
src/pcm_resample.h
View file @
3b565b5f
...
...
@@ -69,6 +69,12 @@ void pcm_resample_init(struct pcm_resample_state *state);
void
pcm_resample_deinit
(
struct
pcm_resample_state
*
state
);
/**
* @see pcm_convert_reset()
*/
void
pcm_resample_reset
(
struct
pcm_resample_state
*
state
);
/**
* Resamples 32 bit float data.
*
* @param state an initialized pcm_resample_state object
...
...
src/pcm_resample_internal.h
View file @
3b565b5f
...
...
@@ -41,6 +41,9 @@ pcm_resample_lsr_init(struct pcm_resample_state *state);
void
pcm_resample_lsr_deinit
(
struct
pcm_resample_state
*
state
);
void
pcm_resample_lsr_reset
(
struct
pcm_resample_state
*
state
);
const
float
*
pcm_resample_lsr_float
(
struct
pcm_resample_state
*
state
,
unsigned
channels
,
...
...
src/pcm_resample_libsamplerate.c
View file @
3b565b5f
...
...
@@ -104,6 +104,13 @@ pcm_resample_lsr_deinit(struct pcm_resample_state *state)
pcm_buffer_deinit
(
&
state
->
buffer
);
}
void
pcm_resample_lsr_reset
(
struct
pcm_resample_state
*
state
)
{
if
(
state
->
state
!=
NULL
)
src_reset
(
state
->
state
);
}
static
bool
pcm_resample_set
(
struct
pcm_resample_state
*
state
,
unsigned
channels
,
unsigned
src_rate
,
unsigned
dest_rate
,
...
...
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