#include "libavutil/samplefmt.h"
#include "avresample.h"
+#include "internal.h"
#include "audio_data.h"
-typedef struct AudioConvert AudioConvert;
-
/**
* Set conversion function if the parameters match.
*
/**
* Allocate and initialize AudioConvert context for sample format conversion.
*
- * @param avr AVAudioResampleContext
- * @param out_fmt output sample format
- * @param in_fmt input sample format
- * @param channels number of channels
- * @return newly-allocated AudioConvert context
+ * @param avr AVAudioResampleContext
+ * @param out_fmt output sample format
+ * @param in_fmt input sample format
+ * @param channels number of channels
+ * @param sample_rate sample rate (used for dithering)
+ * @param apply_map apply channel map during conversion
+ * @return newly-allocated AudioConvert context
*/
AudioConvert *ff_audio_convert_alloc(AVAudioResampleContext *avr,
enum AVSampleFormat out_fmt,
enum AVSampleFormat in_fmt,
- int channels);
+ int channels, int sample_rate,
+ int apply_map);
+
+/**
+ * Free AudioConvert.
+ *
+ * The AudioConvert must have been previously allocated with ff_audio_convert_alloc().
+ *
+ * @param ac AudioConvert struct
+ */
+void ff_audio_convert_free(AudioConvert **ac);
/**
* Convert audio data from one sample format to another.