pcm_resample: add internal function _lsr_init()
Let the libsamplerate code initialize itself.
This commit is contained in:
parent
2b3fd0d4d3
commit
14424281a0
@ -58,16 +58,12 @@ pcm_resample_global_init(GError **error_r)
|
|||||||
|
|
||||||
void pcm_resample_init(struct pcm_resample_state *state)
|
void pcm_resample_init(struct pcm_resample_state *state)
|
||||||
{
|
{
|
||||||
memset(state, 0, sizeof(*state));
|
|
||||||
|
|
||||||
#ifdef HAVE_LIBSAMPLERATE
|
#ifdef HAVE_LIBSAMPLERATE
|
||||||
if (pcm_resample_lsr_enabled()) {
|
if (pcm_resample_lsr_enabled())
|
||||||
pcm_buffer_init(&state->in);
|
pcm_resample_lsr_init(state);
|
||||||
pcm_buffer_init(&state->out);
|
else
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
pcm_resample_fallback_init(state);
|
||||||
pcm_buffer_init(&state->buffer);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void pcm_resample_deinit(struct pcm_resample_state *state)
|
void pcm_resample_deinit(struct pcm_resample_state *state)
|
||||||
|
@ -22,6 +22,12 @@
|
|||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
|
void
|
||||||
|
pcm_resample_fallback_init(struct pcm_resample_state *state)
|
||||||
|
{
|
||||||
|
pcm_buffer_init(&state->buffer);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
pcm_resample_fallback_deinit(struct pcm_resample_state *state)
|
pcm_resample_fallback_deinit(struct pcm_resample_state *state)
|
||||||
{
|
{
|
||||||
|
@ -35,6 +35,9 @@
|
|||||||
bool
|
bool
|
||||||
pcm_resample_lsr_global_init(const char *converter, GError **error_r);
|
pcm_resample_lsr_global_init(const char *converter, GError **error_r);
|
||||||
|
|
||||||
|
void
|
||||||
|
pcm_resample_lsr_init(struct pcm_resample_state *state);
|
||||||
|
|
||||||
void
|
void
|
||||||
pcm_resample_lsr_deinit(struct pcm_resample_state *state);
|
pcm_resample_lsr_deinit(struct pcm_resample_state *state);
|
||||||
|
|
||||||
@ -57,6 +60,9 @@ pcm_resample_lsr_32(struct pcm_resample_state *state,
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
void
|
||||||
|
pcm_resample_fallback_init(struct pcm_resample_state *state);
|
||||||
|
|
||||||
void
|
void
|
||||||
pcm_resample_fallback_deinit(struct pcm_resample_state *state);
|
pcm_resample_fallback_deinit(struct pcm_resample_state *state);
|
||||||
|
|
||||||
|
@ -83,6 +83,16 @@ pcm_resample_lsr_global_init(const char *converter, GError **error_r)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
pcm_resample_lsr_init(struct pcm_resample_state *state)
|
||||||
|
{
|
||||||
|
memset(state, 0, sizeof(*state));
|
||||||
|
|
||||||
|
pcm_buffer_init(&state->in);
|
||||||
|
pcm_buffer_init(&state->out);
|
||||||
|
pcm_buffer_init(&state->buffer);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
pcm_resample_lsr_deinit(struct pcm_resample_state *state)
|
pcm_resample_lsr_deinit(struct pcm_resample_state *state)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user