pcm_convert: add method _reset()
Resets the libsamplerate state. Not being used yet.
This commit is contained in:
parent
0742976138
commit
3b565b5f97
@ -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,
|
||||
|
@ -66,6 +66,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.
|
||||
*
|
||||
|
@ -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,
|
||||
|
@ -68,6 +68,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.
|
||||
*
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user