diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2010-11-03 20:19:34 +0000 |
---|---|---|
committer | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2010-11-03 20:19:34 +0000 |
commit | ba7d6e798eb11b463852479a5e09a68926e82af6 (patch) | |
tree | 20e8a1da86432da35c75c0578b4f297ea48aa6b5 /libavcodec | |
parent | caa7ad5dc68a9b287a49f1d34f557274d3feee9c (diff) | |
download | ffmpeg-ba7d6e798eb11b463852479a5e09a68926e82af6.tar.gz |
Remove usage of deprecated libavcodec/audioconvert.h functions.
Originally committed as revision 25668 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/alsdec.c | 5 | ||||
-rw-r--r-- | libavcodec/resample.c | 9 | ||||
-rw-r--r-- | libavcodec/utils.c | 3 |
3 files changed, 10 insertions, 7 deletions
diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c index 352506b159..6993bb98a6 100644 --- a/libavcodec/alsdec.c +++ b/libavcodec/alsdec.c @@ -36,6 +36,7 @@ #include "bytestream.h" #include "bgmc.h" #include "dsputil.h" +#include "libavcore/samplefmt.h" #include "libavutil/crc.h" #include <stdint.h> @@ -1426,7 +1427,7 @@ static int decode_frame(AVCodecContext *avctx, // check for size of decoded data size = ctx->cur_frame_length * avctx->channels * - (av_get_bits_per_sample_format(avctx->sample_fmt) >> 3); + (av_get_bits_per_sample_fmt(avctx->sample_fmt) >> 3); if (size > *data_size) { av_log(avctx, AV_LOG_ERROR, "Decoded data exceeds buffer size.\n"); @@ -1679,7 +1680,7 @@ static av_cold int decode_init(AVCodecContext *avctx) ctx->crc_buffer = av_malloc(sizeof(*ctx->crc_buffer) * ctx->cur_frame_length * avctx->channels * - (av_get_bits_per_sample_format(avctx->sample_fmt) >> 3)); + (av_get_bits_per_sample_fmt(avctx->sample_fmt) >> 3)); if (!ctx->crc_buffer) { av_log(avctx, AV_LOG_ERROR, "Allocating buffer memory failed.\n"); decode_end(avctx); diff --git a/libavcodec/resample.c b/libavcodec/resample.c index 222b28ce83..89e2d71e53 100644 --- a/libavcodec/resample.c +++ b/libavcodec/resample.c @@ -27,6 +27,7 @@ #include "avcodec.h" #include "audioconvert.h" #include "libavutil/opt.h" +#include "libavcore/samplefmt.h" struct AVResampleContext; @@ -174,15 +175,15 @@ ReSampleContext *av_audio_resample_init(int output_channels, int input_channels, s->sample_fmt [0] = sample_fmt_in; s->sample_fmt [1] = sample_fmt_out; - s->sample_size[0] = av_get_bits_per_sample_format(s->sample_fmt[0])>>3; - s->sample_size[1] = av_get_bits_per_sample_format(s->sample_fmt[1])>>3; + s->sample_size[0] = av_get_bits_per_sample_fmt(s->sample_fmt[0])>>3; + s->sample_size[1] = av_get_bits_per_sample_fmt(s->sample_fmt[1])>>3; if (s->sample_fmt[0] != SAMPLE_FMT_S16) { if (!(s->convert_ctx[0] = av_audio_convert_alloc(SAMPLE_FMT_S16, 1, s->sample_fmt[0], 1, NULL, 0))) { av_log(s, AV_LOG_ERROR, "Cannot convert %s sample format to s16 sample format\n", - avcodec_get_sample_fmt_name(s->sample_fmt[0])); + av_get_sample_fmt_name(s->sample_fmt[0])); av_free(s); return NULL; } @@ -193,7 +194,7 @@ ReSampleContext *av_audio_resample_init(int output_channels, int input_channels, SAMPLE_FMT_S16, 1, NULL, 0))) { av_log(s, AV_LOG_ERROR, "Cannot convert s16 sample format to %s sample format\n", - avcodec_get_sample_fmt_name(s->sample_fmt[1])); + av_get_sample_fmt_name(s->sample_fmt[1])); av_audio_convert_free(s->convert_ctx[0]); av_free(s); return NULL; diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 8169b374b5..4d13e0aa6e 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -30,6 +30,7 @@ #include "libavutil/crc.h" #include "libavutil/pixdesc.h" #include "libavcore/imgutils.h" +#include "libavcore/samplefmt.h" #include "avcodec.h" #include "dsputil.h" #include "libavutil/opt.h" @@ -923,7 +924,7 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode) avcodec_get_channel_layout_string(buf + strlen(buf), buf_size - strlen(buf), enc->channels, enc->channel_layout); if (enc->sample_fmt != SAMPLE_FMT_NONE) { snprintf(buf + strlen(buf), buf_size - strlen(buf), - ", %s", avcodec_get_sample_fmt_name(enc->sample_fmt)); + ", %s", av_get_sample_fmt_name(enc->sample_fmt)); } break; case AVMEDIA_TYPE_DATA: |