avresample: Mark avresample_buffer() as pointer to const

That buffer is read only and marking it accordingly let
the user passing a constant buffer to it without having
a const-correctness warning.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
pull/172/head
Kip Warner 9 years ago committed by Luca Barbato
parent 5bc223b15d
commit cc4c242081
  1. 7
      libavresample/audio_data.c
  2. 7
      libavresample/audio_data.h
  3. 5
      libavresample/avresample.h
  4. 3
      libavresample/utils.c

@ -70,9 +70,10 @@ int ff_audio_data_set_channels(AudioData *a, int channels)
return 0; return 0;
} }
int ff_audio_data_init(AudioData *a, uint8_t **src, int plane_size, int channels, int ff_audio_data_init(AudioData *a, uint8_t * const *src, int plane_size,
int nb_samples, enum AVSampleFormat sample_fmt, int channels, int nb_samples,
int read_only, const char *name) enum AVSampleFormat sample_fmt, int read_only,
const char *name)
{ {
int p; int p;

@ -76,9 +76,10 @@ int ff_audio_data_set_channels(AudioData *a, int channels);
* @param name name for debug logging (can be NULL) * @param name name for debug logging (can be NULL)
* @return 0 on success, negative AVERROR value on error * @return 0 on success, negative AVERROR value on error
*/ */
int ff_audio_data_init(AudioData *a, uint8_t **src, int plane_size, int channels, int ff_audio_data_init(AudioData *a, uint8_t * const *src, int plane_size,
int nb_samples, enum AVSampleFormat sample_fmt, int channels, int nb_samples,
int read_only, const char *name); enum AVSampleFormat sample_fmt, int read_only,
const char *name);
/** /**
* Allocate AudioData. * Allocate AudioData.

@ -377,8 +377,9 @@ int avresample_get_out_samples(AVAudioResampleContext *avr, int in_nb_samples);
* output FIFO * output FIFO
*/ */
int avresample_convert(AVAudioResampleContext *avr, uint8_t **output, int avresample_convert(AVAudioResampleContext *avr, uint8_t **output,
int out_plane_size, int out_samples, uint8_t **input, int out_plane_size, int out_samples,
int in_plane_size, int in_samples); uint8_t * const *input, int in_plane_size,
int in_samples);
/** /**
* Return the number of samples currently in the resampling delay buffer. * Return the number of samples currently in the resampling delay buffer.

@ -329,7 +329,8 @@ static int handle_buffered_output(AVAudioResampleContext *avr,
int attribute_align_arg avresample_convert(AVAudioResampleContext *avr, int attribute_align_arg avresample_convert(AVAudioResampleContext *avr,
uint8_t **output, int out_plane_size, uint8_t **output, int out_plane_size,
int out_samples, uint8_t **input, int out_samples,
uint8_t * const *input,
int in_plane_size, int in_samples) int in_plane_size, int in_samples)
{ {
AudioData input_buffer; AudioData input_buffer;

Loading…
Cancel
Save