av_get_bits_per_sample_fmt() is deprecated.
---
 libavcodec/aacdec.c       |    2 +-
 libavcodec/ac3dec.c       |    2 +-
 libavcodec/alsdec.c       |    4 ++--
 libavcodec/dca.c          |    2 +-
 libavcodec/resample.c     |    4 ++--
 libavcodec/utils.c        |    2 +-
 libavcodec/vmdav.c        |    2 +-
 libavcodec/vorbisdec.c    |    2 +-
 libavformat/matroskaenc.c |    2 +-
 9 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c
index 69aacb8..26ce204 100644
--- a/libavcodec/aacdec.c
+++ b/libavcodec/aacdec.c
@@ -2177,7 +2177,7 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
     }
 
     data_size_tmp = samples * avctx->channels *
-                    (av_get_bits_per_sample_fmt(avctx->sample_fmt) / 8);
+                    av_get_bytes_per_sample(avctx->sample_fmt);
     if (*data_size < data_size_tmp) {
         av_log(avctx, AV_LOG_ERROR,
                "Output buffer too small (%d) or trying to output too many samples (%d) for this frame.\n",
diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c
index 2966c33..42b62ef 100644
--- a/libavcodec/ac3dec.c
+++ b/libavcodec/ac3dec.c
@@ -1422,7 +1422,7 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data, int *data_size,
         }
     }
     *data_size = s->num_blocks * 256 * avctx->channels *
-                 (av_get_bits_per_sample_fmt(avctx->sample_fmt) / 8);
+                 av_get_bytes_per_sample(avctx->sample_fmt);
     return FFMIN(buf_size, s->frame_size);
 }
 
diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
index 17c5490..055bfd0 100644
--- a/libavcodec/alsdec.c
+++ b/libavcodec/alsdec.c
@@ -1450,7 +1450,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_fmt(avctx->sample_fmt) >> 3);
+           av_get_bytes_per_sample(avctx->sample_fmt);
 
     if (size > *data_size) {
         av_log(avctx, AV_LOG_ERROR, "Decoded data exceeds buffer size.\n");
@@ -1714,7 +1714,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_fmt(avctx->sample_fmt) >> 3));
+                                    av_get_bytes_per_sample(avctx->sample_fmt));
         if (!ctx->crc_buffer) {
             av_log(avctx, AV_LOG_ERROR, "Allocating buffer memory failed.\n");
             decode_end(avctx);
diff --git a/libavcodec/dca.c b/libavcodec/dca.c
index a9b2c9b..68731c9 100644
--- a/libavcodec/dca.c
+++ b/libavcodec/dca.c
@@ -1813,7 +1813,7 @@ static int dca_decode_frame(AVCodecContext * avctx,
     }
 
     out_size = 256 / 8 * s->sample_blocks * channels *
-               (av_get_bits_per_sample_fmt(avctx->sample_fmt) / 8);
+               av_get_bytes_per_sample(avctx->sample_fmt);
     if (*data_size < out_size)
         return -1;
     *data_size = out_size;
diff --git a/libavcodec/resample.c b/libavcodec/resample.c
index 0bebe1a..04bbbf0 100644
--- a/libavcodec/resample.c
+++ b/libavcodec/resample.c
@@ -187,8 +187,8 @@ 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_fmt(s->sample_fmt[0]) >> 3;
-    s->sample_size[1] = av_get_bits_per_sample_fmt(s->sample_fmt[1]) >> 3;
+    s->sample_size[0] = av_get_bytes_per_sample(s->sample_fmt[0]);
+    s->sample_size[1] = av_get_bytes_per_sample(s->sample_fmt[1]);
 
     if (s->sample_fmt[0] != AV_SAMPLE_FMT_S16) {
         if (!(s->convert_ctx[0] = av_audio_convert_alloc(AV_SAMPLE_FMT_S16, 1,
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 1e58864..146dd30 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1131,7 +1131,7 @@ int av_get_bits_per_sample(enum CodecID codec_id){
 
 #if FF_API_OLD_SAMPLE_FMT
 int av_get_bits_per_sample_format(enum AVSampleFormat sample_fmt) {
-    return av_get_bits_per_sample_fmt(sample_fmt);
+    return av_get_bytes_per_sample(sample_fmt) << 3;
 }
 #endif
 
diff --git a/libavcodec/vmdav.c b/libavcodec/vmdav.c
index d258252..283c213 100644
--- a/libavcodec/vmdav.c
+++ b/libavcodec/vmdav.c
@@ -447,7 +447,7 @@ static av_cold int vmdaudio_decode_init(AVCodecContext *avctx)
         avctx->sample_fmt = AV_SAMPLE_FMT_S16;
     else
         avctx->sample_fmt = AV_SAMPLE_FMT_U8;
-    s->out_bps = av_get_bits_per_sample_fmt(avctx->sample_fmt) >> 3;
+    s->out_bps = av_get_bytes_per_sample(avctx->sample_fmt);
 
     av_log(avctx, AV_LOG_DEBUG, "%d channels, %d bits/sample, "
            "block align = %d, sample rate = %d\n",
diff --git a/libavcodec/vorbisdec.c b/libavcodec/vorbisdec.c
index 017102e..9fc6068 100644
--- a/libavcodec/vorbisdec.c
+++ b/libavcodec/vorbisdec.c
@@ -1646,7 +1646,7 @@ static int vorbis_decode_frame(AVCodecContext *avccontext,
                                                vc->audio_channels);
 
     *data_size = len * vc->audio_channels *
-                 (av_get_bits_per_sample_fmt(avccontext->sample_fmt) / 8);
+                 av_get_bytes_per_sample(avccontext->sample_fmt);
 
     return buf_size ;
 }
diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index ba2ce28..972aa8a 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -526,7 +526,7 @@ static int mkv_write_tracks(AVFormatContext *s)
         AVMetadataTag *tag;
 
         if (!bit_depth)
-            bit_depth = av_get_bits_per_sample_fmt(codec->sample_fmt);
+            bit_depth = av_get_bytes_per_sample(codec->sample_fmt) << 3;
 
         if (codec->codec_id == CODEC_ID_AAC)
             get_aac_sample_rates(s, codec, &sample_rate, &output_sample_rate);
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to