Commit e7ba5b1d authored by Anton Khirnov's avatar 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.
parent 30223b3b
......@@ -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) {
......
......@@ -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:
......
......@@ -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);
......
......@@ -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)
{
......
......@@ -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);
......
......@@ -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));
......
......@@ -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 */
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment