summaryrefslogtreecommitdiff
path: root/libavresample
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2015-09-05 15:59:40 +0200
committerHendrik Leppkes <h.leppkes@gmail.com>2015-09-05 15:59:40 +0200
commite2adb00ec587dd48746b0d24648005d22c91423c (patch)
tree15ead55f8dc655070b886d8bed6c5fbb3dd4922c /libavresample
parentcebe51a6255e04b8dcd15fcbab359ed00dbb3ab1 (diff)
parent11b2eed43e91b35b8295ed47115cae2e29bd687d (diff)
downloadffmpeg-e2adb00ec587dd48746b0d24648005d22c91423c.tar.gz
Merge commit '11b2eed43e91b35b8295ed47115cae2e29bd687d'
* commit '11b2eed43e91b35b8295ed47115cae2e29bd687d': lavr: Drop deprecated context reinitialization if resampling was not enabled Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
Diffstat (limited to 'libavresample')
-rw-r--r--libavresample/resample.c54
-rw-r--r--libavresample/version.h4
2 files changed, 0 insertions, 58 deletions
diff --git a/libavresample/resample.c b/libavresample/resample.c
index 01fc50014d..cc0fe79a05 100644
--- a/libavresample/resample.c
+++ b/libavresample/resample.c
@@ -243,62 +243,8 @@ int avresample_set_compensation(AVAudioResampleContext *avr, int sample_delta,
return AVERROR(EINVAL);
if (!avr->resample_needed) {
-#if FF_API_RESAMPLE_CLOSE_OPEN
- /* if resampling was not enabled previously, re-initialize the
- AVAudioResampleContext and force resampling */
- int fifo_samples;
- int restore_matrix = 0;
- double matrix[AVRESAMPLE_MAX_CHANNELS * AVRESAMPLE_MAX_CHANNELS] = { 0 };
-
- /* buffer any remaining samples in the output FIFO before closing */
- fifo_samples = av_audio_fifo_size(avr->out_fifo);
- if (fifo_samples > 0) {
- fifo_buf = ff_audio_data_alloc(avr->out_channels, fifo_samples,
- avr->out_sample_fmt, NULL);
- if (!fifo_buf)
- return AVERROR(EINVAL);
- ret = ff_audio_data_read_from_fifo(avr->out_fifo, fifo_buf,
- fifo_samples);
- if (ret < 0)
- goto reinit_fail;
- }
- /* save the channel mixing matrix */
- if (avr->am) {
- ret = avresample_get_matrix(avr, matrix, AVRESAMPLE_MAX_CHANNELS);
- if (ret < 0)
- goto reinit_fail;
- restore_matrix = 1;
- }
-
- /* close the AVAudioResampleContext */
- avresample_close(avr);
-
- avr->force_resampling = 1;
-
- /* restore the channel mixing matrix */
- if (restore_matrix) {
- ret = avresample_set_matrix(avr, matrix, AVRESAMPLE_MAX_CHANNELS);
- if (ret < 0)
- goto reinit_fail;
- }
-
- /* re-open the AVAudioResampleContext */
- ret = avresample_open(avr);
- if (ret < 0)
- goto reinit_fail;
-
- /* restore buffered samples to the output FIFO */
- if (fifo_samples > 0) {
- ret = ff_audio_data_add_to_fifo(avr->out_fifo, fifo_buf, 0,
- fifo_samples);
- if (ret < 0)
- goto reinit_fail;
- ff_audio_data_free(&fifo_buf);
- }
-#else
av_log(avr, AV_LOG_ERROR, "Unable to set resampling compensation\n");
return AVERROR(EINVAL);
-#endif
}
c = avr->resample;
c->compensation_distance = compensation_distance;
diff --git a/libavresample/version.h b/libavresample/version.h
index 33ff2a2afa..6a6cb2fbfe 100644
--- a/libavresample/version.h
+++ b/libavresample/version.h
@@ -47,8 +47,4 @@
* the public API and may change, break or disappear at any time.
*/
-#ifndef FF_API_RESAMPLE_CLOSE_OPEN
-#define FF_API_RESAMPLE_CLOSE_OPEN (LIBAVRESAMPLE_VERSION_MAJOR < 3)
-#endif
-
#endif /* AVRESAMPLE_VERSION_H */