aboutsummaryrefslogtreecommitdiffstats
path: root/src/pcm_resample.h
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-01-08 00:46:38 +0100
committerMax Kellermann <max@duempel.org>2009-01-08 00:46:38 +0100
commit2a83138913dbfc90958c52527fbfc1fc1bbf76e5 (patch)
treedd46a56d1c4f3ae7d49fdb00ce3f5d06e9628d2e /src/pcm_resample.h
parentaab85577bf7576895ccae0403d5cb95aa113f7f0 (diff)
downloadmpd-2a83138913dbfc90958c52527fbfc1fc1bbf76e5.tar.gz
mpd-2a83138913dbfc90958c52527fbfc1fc1bbf76e5.tar.xz
mpd-2a83138913dbfc90958c52527fbfc1fc1bbf76e5.zip
pcm_resample: use pcm_buffer (1/2)
Return a temporary buffer from pcm_resample_*() and pcm_convert().
Diffstat (limited to 'src/pcm_resample.h')
-rw-r--r--src/pcm_resample.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/pcm_resample.h b/src/pcm_resample.h
index 69bf6316d..8a428d90b 100644
--- a/src/pcm_resample.h
+++ b/src/pcm_resample.h
@@ -20,6 +20,7 @@
#ifndef MPD_PCM_RESAMPLE_H
#define MPD_PCM_RESAMPLE_H
+#include "pcm_buffer.h"
#include "config.h"
#include <stdint.h>
@@ -44,30 +45,29 @@ struct pcm_resample_state {
} prev;
bool error;
-#else
- /* struct must not be empty */
- int dummy;
#endif
+
+ struct pcm_buffer buffer;
};
void pcm_resample_init(struct pcm_resample_state *state);
void pcm_resample_deinit(struct pcm_resample_state *state);
-size_t
-pcm_resample_16(uint8_t channels,
+const int16_t *
+pcm_resample_16(struct pcm_resample_state *state,
+ uint8_t channels,
unsigned src_rate,
const int16_t *src_buffer, size_t src_size,
unsigned dest_rate,
- int16_t *dest_buffer, size_t dest_size,
- struct pcm_resample_state *state);
+ size_t *dest_size_r);
-size_t
-pcm_resample_24(uint8_t channels,
+const int32_t *
+pcm_resample_24(struct pcm_resample_state *state,
+ uint8_t channels,
unsigned src_rate,
const int32_t *src_buffer, size_t src_size,
unsigned dest_rate,
- int32_t *dest_buffer, size_t dest_size,
- struct pcm_resample_state *state);
+ size_t *dest_size_r);
#endif