diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2012-10-31 15:40:12 -0400 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2012-12-19 18:52:54 -0500 |
commit | b2fe6756e34d1316d0fa799e8a5ace993059c407 (patch) | |
tree | 0fc8dea25140a8af90cdfb96af5b5d8f97560ab7 /libavresample/utils.c | |
parent | 582368626188c070d4300913c6da5efa4c24cfb2 (diff) | |
download | ffmpeg-b2fe6756e34d1316d0fa799e8a5ace993059c407.tar.gz |
lavr: add option for dithering during sample format conversion to s16
Diffstat (limited to 'libavresample/utils.c')
-rw-r--r-- | libavresample/utils.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libavresample/utils.c b/libavresample/utils.c index fe2e1c266b..ed7f470483 100644 --- a/libavresample/utils.c +++ b/libavresample/utils.c @@ -142,7 +142,8 @@ int avresample_open(AVAudioResampleContext *avr) /* setup contexts */ if (avr->in_convert_needed) { avr->ac_in = ff_audio_convert_alloc(avr, avr->internal_sample_fmt, - avr->in_sample_fmt, avr->in_channels); + avr->in_sample_fmt, avr->in_channels, + avr->in_sample_rate); if (!avr->ac_in) { ret = AVERROR(ENOMEM); goto error; @@ -155,7 +156,8 @@ int avresample_open(AVAudioResampleContext *avr) else src_fmt = avr->in_sample_fmt; avr->ac_out = ff_audio_convert_alloc(avr, avr->out_sample_fmt, src_fmt, - avr->out_channels); + avr->out_channels, + avr->out_sample_rate); if (!avr->ac_out) { ret = AVERROR(ENOMEM); goto error; @@ -190,8 +192,8 @@ void avresample_close(AVAudioResampleContext *avr) ff_audio_data_free(&avr->out_buffer); av_audio_fifo_free(avr->out_fifo); avr->out_fifo = NULL; - av_freep(&avr->ac_in); - av_freep(&avr->ac_out); + ff_audio_convert_free(&avr->ac_in); + ff_audio_convert_free(&avr->ac_out); ff_audio_resample_free(&avr->resample); ff_audio_mix_free(&avr->am); av_freep(&avr->mix_matrix); |