[FFmpeg-cvslog] lavr: change the type of the data buffers to uint8_t**.
Anton Khirnov
git at videolan.org
Sat Oct 6 13:57:07 CEST 2012
ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Fri Oct 5 06:56:00 2012 +0200| [e7ba5b1de063e9b1de441b0d1c5708857f739fa5] | committer: Anton Khirnov
lavr: change the type of the data buffers to uint8_t**.
This is more consistent with what the rest of Libav does.
This breaks API.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e7ba5b1de063e9b1de441b0d1c5708857f739fa5
---
avplay.c | 4 ++--
libavfilter/af_asyncts.c | 8 ++++----
libavfilter/af_resample.c | 6 +++---
libavresample/audio_data.c | 2 +-
libavresample/audio_data.h | 2 +-
libavresample/avresample-test.c | 4 ++--
libavresample/avresample.h | 6 +++---
libavresample/utils.c | 8 ++++----
8 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/avplay.c b/avplay.c
index ead79f3..b1f2598 100644
--- a/avplay.c
+++ b/avplay.c
@@ -1961,9 +1961,9 @@ static int audio_decode_frame(VideoState *is, double *pts_ptr)
is->audio_buf1 = tmp_out;
out_samples = avresample_convert(is->avr,
- (void **)&is->audio_buf1,
+ &is->audio_buf1,
out_linesize, nb_samples,
- (void **)is->frame->data,
+ is->frame->data,
is->frame->linesize[0],
is->frame->nb_samples);
if (out_samples < 0) {
diff --git a/libavfilter/af_asyncts.c b/libavfilter/af_asyncts.c
index 0b8be8d..c7eb86d 100644
--- a/libavfilter/af_asyncts.c
+++ b/libavfilter/af_asyncts.c
@@ -133,7 +133,7 @@ static int request_frame(AVFilterLink *link)
nb_samples);
if (!buf)
return AVERROR(ENOMEM);
- ret = avresample_convert(s->avr, (void**)buf->extended_data,
+ ret = avresample_convert(s->avr, buf->extended_data,
buf->linesize[0], nb_samples, NULL, 0, 0);
if (ret <= 0) {
avfilter_unref_bufferp(&buf);
@@ -149,7 +149,7 @@ static int request_frame(AVFilterLink *link)
static int write_to_fifo(ASyncContext *s, AVFilterBufferRef *buf)
{
- int ret = avresample_convert(s->avr, NULL, 0, 0, (void**)buf->extended_data,
+ int ret = avresample_convert(s->avr, NULL, 0, 0, buf->extended_data,
buf->linesize[0], buf->audio->nb_samples);
avfilter_unref_buffer(buf);
return ret;
@@ -210,7 +210,7 @@ static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *buf)
goto fail;
}
- avresample_read(s->avr, (void**)buf_out->extended_data, out_size);
+ avresample_read(s->avr, buf_out->extended_data, out_size);
buf_out->pts = s->pts;
if (delta > 0) {
@@ -230,7 +230,7 @@ static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *buf)
avresample_read(s->avr, NULL, avresample_available(s->avr));
s->pts = pts - avresample_get_delay(s->avr);
- ret = avresample_convert(s->avr, NULL, 0, 0, (void**)buf->extended_data,
+ ret = avresample_convert(s->avr, NULL, 0, 0, buf->extended_data,
buf->linesize[0], buf->audio->nb_samples);
fail:
diff --git a/libavfilter/af_resample.c b/libavfilter/af_resample.c
index eb2d2f9..c51f9d2 100644
--- a/libavfilter/af_resample.c
+++ b/libavfilter/af_resample.c
@@ -149,7 +149,7 @@ static int request_frame(AVFilterLink *outlink)
if (!buf)
return AVERROR(ENOMEM);
- ret = avresample_convert(s->avr, (void**)buf->extended_data,
+ ret = avresample_convert(s->avr, buf->extended_data,
buf->linesize[0], nb_samples,
NULL, 0, 0);
if (ret <= 0) {
@@ -186,9 +186,9 @@ static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *buf)
goto fail;
}
- ret = avresample_convert(s->avr, (void**)buf_out->extended_data,
+ ret = avresample_convert(s->avr, buf_out->extended_data,
buf_out->linesize[0], nb_samples,
- (void**)buf->extended_data, buf->linesize[0],
+ buf->extended_data, buf->linesize[0],
buf->audio->nb_samples);
if (ret < 0) {
avfilter_unref_buffer(buf_out);
diff --git a/libavresample/audio_data.c b/libavresample/audio_data.c
index d624ad3..199a68c 100644
--- a/libavresample/audio_data.c
+++ b/libavresample/audio_data.c
@@ -62,7 +62,7 @@ int ff_audio_data_set_channels(AudioData *a, int channels)
return 0;
}
-int ff_audio_data_init(AudioData *a, void **src, int plane_size, int channels,
+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)
{
diff --git a/libavresample/audio_data.h b/libavresample/audio_data.h
index 4609ebc..558e7e6 100644
--- a/libavresample/audio_data.h
+++ b/libavresample/audio_data.h
@@ -73,7 +73,7 @@ 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, void **src, int plane_size, int channels,
+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);
diff --git a/libavresample/avresample-test.c b/libavresample/avresample-test.c
index 0d4f2df..ab49e48 100644
--- a/libavresample/avresample-test.c
+++ b/libavresample/avresample-test.c
@@ -305,8 +305,8 @@ int main(int argc, char **argv)
goto end;
}
- ret = avresample_convert(s, (void **)out_data, out_linesize, out_rate * 6,
- (void **) in_data, in_linesize, in_rate * 6);
+ ret = avresample_convert(s, out_data, out_linesize, out_rate * 6,
+ in_data, in_linesize, in_rate * 6);
if (ret < 0) {
char errbuf[256];
av_strerror(ret, errbuf, sizeof(errbuf));
diff --git a/libavresample/avresample.h b/libavresample/avresample.h
index b93aba5..ea93952 100644
--- a/libavresample/avresample.h
+++ b/libavresample/avresample.h
@@ -234,8 +234,8 @@ int avresample_set_compensation(AVAudioResampleContext *avr, int sample_delta,
* not including converted samples added to the internal
* output FIFO
*/
-int avresample_convert(AVAudioResampleContext *avr, void **output,
- int out_plane_size, int out_samples, void **input,
+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);
/**
@@ -287,6 +287,6 @@ int avresample_available(AVAudioResampleContext *avr);
* @param nb_samples number of samples to read from the FIFO
* @return the number of samples written to output
*/
-int avresample_read(AVAudioResampleContext *avr, void **output, int nb_samples);
+int avresample_read(AVAudioResampleContext *avr, uint8_t **output, int nb_samples);
#endif /* AVRESAMPLE_AVRESAMPLE_H */
diff --git a/libavresample/utils.c b/libavresample/utils.c
index 4819b57..378dd48 100644
--- a/libavresample/utils.c
+++ b/libavresample/utils.c
@@ -247,8 +247,8 @@ static int handle_buffered_output(AVAudioResampleContext *avr,
}
int attribute_align_arg avresample_convert(AVAudioResampleContext *avr,
- void **output, int out_plane_size,
- int out_samples, void **input,
+ uint8_t **output, int out_plane_size,
+ int out_samples, uint8_t **input,
int in_plane_size, int in_samples)
{
AudioData input_buffer;
@@ -410,11 +410,11 @@ int avresample_available(AVAudioResampleContext *avr)
return av_audio_fifo_size(avr->out_fifo);
}
-int avresample_read(AVAudioResampleContext *avr, void **output, int nb_samples)
+int avresample_read(AVAudioResampleContext *avr, uint8_t **output, int nb_samples)
{
if (!output)
return av_audio_fifo_drain(avr->out_fifo, nb_samples);
- return av_audio_fifo_read(avr->out_fifo, output, nb_samples);
+ return av_audio_fifo_read(avr->out_fifo, (void**)output, nb_samples);
}
unsigned avresample_version(void)
More information about the ffmpeg-cvslog
mailing list