aboutsummaryrefslogtreecommitdiff
path: root/src/pcm_convert.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/pcm_convert.h')
-rw-r--r--src/pcm_convert.h29
1 files changed, 12 insertions, 17 deletions
diff --git a/src/pcm_convert.h b/src/pcm_convert.h
index be11a6e4..b9b1af17 100644
--- a/src/pcm_convert.h
+++ b/src/pcm_convert.h
@@ -21,10 +21,13 @@
#define PCM_CONVERT_H
#include "pcm_dsd.h"
-#include "pcm_resample.h"
#include "pcm_dither.h"
#include "pcm_buffer.h"
+#include <libavutil/frame.h>
+#include <libavutil/samplefmt.h>
+#include <libavresample/avresample.h>
+
struct audio_format;
/**
@@ -35,15 +38,10 @@ struct audio_format;
struct pcm_convert_state {
struct pcm_dsd dsd;
- struct pcm_resample_state resample;
-
- struct pcm_dither dither;
-
- /** the buffer for converting the sample format */
- struct pcm_buffer format_buffer;
-
- /** the buffer for converting the channel count */
- struct pcm_buffer channels_buffer;
+ AVAudioResampleContext *avr;
+ enum AVSampleFormat dst_format;
+ int dst_samplerate;
+ uint64_t dst_channel_layout;
};
static inline GQuark
@@ -83,12 +81,9 @@ pcm_convert_reset(struct pcm_convert_state *state);
* ignore errors
* @return the destination buffer, or NULL on error
*/
-const void *
-pcm_convert(struct pcm_convert_state *state,
- const struct audio_format *src_format,
- const void *src, size_t src_size,
- const struct audio_format *dest_format,
- size_t *dest_size_r,
- GError **error_r);
+AVFrame *pcm_convert(struct pcm_convert_state *state,
+ const struct audio_format *src_format,
+ const struct audio_format *dest_format,
+ const AVFrame *src);
#endif