summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKip Warner <kip@thevertigo.com>2015-12-10 15:52:50 -0800
committerLuca Barbato <lu_zero@gentoo.org>2015-12-14 15:16:33 +0100
commitcc4c24208159200b7aff5b5c313903c7f23fa345 (patch)
treeafd5f78231b1b8ba129d6f15ebd2af3ae37cff5b
parent5bc223b15d064e328ff90b0241fa1191f1d2786d (diff)
downloadffmpeg-streaming-cc4c24208159200b7aff5b5c313903c7f23fa345.zip
ffmpeg-streaming-cc4c24208159200b7aff5b5c313903c7f23fa345.tar.gz
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>
-rw-r--r--libavresample/audio_data.c7
-rw-r--r--libavresample/audio_data.h7
-rw-r--r--libavresample/avresample.h5
-rw-r--r--libavresample/utils.c3
4 files changed, 13 insertions, 9 deletions
diff --git a/libavresample/audio_data.c b/libavresample/audio_data.c
index 7a6fe745..2d01b8c 100644
--- a/libavresample/audio_data.c
+++ b/libavresample/audio_data.c
@@ -70,9 +70,10 @@ int ff_audio_data_set_channels(AudioData *a, int channels)
return 0;
}
-int ff_audio_data_init(AudioData *a, uint8_t **src, int plane_size, int channels,
- int nb_samples, enum AVSampleFormat sample_fmt,
- int read_only, const char *name)
+int ff_audio_data_init(AudioData *a, uint8_t * const *src, int plane_size,
+ int channels, int nb_samples,
+ enum AVSampleFormat sample_fmt, int read_only,
+ const char *name)
{
int p;
diff --git a/libavresample/audio_data.h b/libavresample/audio_data.h
index 1541976..a478592 100644
--- a/libavresample/audio_data.h
+++ b/libavresample/audio_data.h
@@ -76,9 +76,10 @@ int ff_audio_data_set_channels(AudioData *a, int channels);
* @param name name for debug logging (can be NULL)
* @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 nb_samples, enum AVSampleFormat sample_fmt,
- int read_only, const char *name);
+int ff_audio_data_init(AudioData *a, uint8_t * const *src, int plane_size,
+ int channels, int nb_samples,
+ enum AVSampleFormat sample_fmt, int read_only,
+ const char *name);
/**
* Allocate AudioData.
diff --git a/libavresample/avresample.h b/libavresample/avresample.h
index 1dca6e4..c66798c 100644
--- a/libavresample/avresample.h
+++ b/libavresample/avresample.h
@@ -377,8 +377,9 @@ int avresample_get_out_samples(AVAudioResampleContext *avr, int in_nb_samples);
* output FIFO
*/
int avresample_convert(AVAudioResampleContext *avr, uint8_t **output,
- int out_plane_size, int out_samples, uint8_t **input,
- int in_plane_size, int in_samples);
+ int out_plane_size, int out_samples,
+ uint8_t * const *input, int in_plane_size,
+ int in_samples);
/**
* Return the number of samples currently in the resampling delay buffer.
diff --git a/libavresample/utils.c b/libavresample/utils.c
index 172aadb..bab2153 100644
--- a/libavresample/utils.c
+++ b/libavresample/utils.c
@@ -329,7 +329,8 @@ static int handle_buffered_output(AVAudioResampleContext *avr,
int attribute_align_arg avresample_convert(AVAudioResampleContext *avr,
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)
{
AudioData input_buffer;
OpenPOWER on IntegriCloud