summaryrefslogtreecommitdiff
path: root/libavcodec/s302m.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2013-09-06 16:32:47 +0000
committerPaul B Mahol <onemda@gmail.com>2013-09-06 17:43:35 +0000
commitc9b5ad124e9b0f96b7b9bcbee5a45501c5221d46 (patch)
tree4265fec1815756b7e65f27675b1da1c20a0c1228 /libavcodec/s302m.c
parent6b024d8a7ac37247c8d8c78b13deb81f178dd83f (diff)
downloadffmpeg-c9b5ad124e9b0f96b7b9bcbee5a45501c5221d46.tar.gz
s302m: s/bits_per_coded_sample/bits_per_raw_sample
bits_per_coded_sample should be set from demuxer and not from decoder. Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavcodec/s302m.c')
-rw-r--r--libavcodec/s302m.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libavcodec/s302m.c b/libavcodec/s302m.c
index 5f73148f77..56aea75aaa 100644
--- a/libavcodec/s302m.c
+++ b/libavcodec/s302m.c
@@ -59,7 +59,7 @@ static int s302m_parse_frame_header(AVCodecContext *avctx, const uint8_t *buf,
}
/* Set output properties */
- avctx->bits_per_coded_sample = bits;
+ avctx->bits_per_raw_sample = bits;
if (bits > 16)
avctx->sample_fmt = AV_SAMPLE_FMT_S32;
else
@@ -80,10 +80,10 @@ static int s302m_parse_frame_header(AVCodecContext *avctx, const uint8_t *buf,
avctx->channel_layout = AV_CH_LAYOUT_5POINT1_BACK | AV_CH_LAYOUT_STEREO_DOWNMIX;
}
avctx->sample_rate = 48000;
- avctx->bit_rate = 48000 * avctx->channels * (avctx->bits_per_coded_sample + 4) +
+ avctx->bit_rate = 48000 * avctx->channels * (avctx->bits_per_raw_sample + 4) +
32 * (48000 / (buf_size * 8 /
(avctx->channels *
- (avctx->bits_per_coded_sample + 4))));
+ (avctx->bits_per_raw_sample + 4))));
return frame_size;
}
@@ -104,14 +104,14 @@ static int s302m_decode_frame(AVCodecContext *avctx, void *data,
buf += AES3_HEADER_LEN;
/* get output buffer */
- block_size = (avctx->bits_per_coded_sample + 4) / 4;
+ block_size = (avctx->bits_per_raw_sample + 4) / 4;
frame->nb_samples = 2 * (buf_size / block_size) / avctx->channels;
if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
return ret;
buf_size = (frame->nb_samples * avctx->channels / 2) * block_size;
- if (avctx->bits_per_coded_sample == 24) {
+ if (avctx->bits_per_raw_sample == 24) {
uint32_t *o = (uint32_t *)frame->data[0];
for (; buf_size > 6; buf_size -= 7) {
*o++ = (ff_reverse[buf[2]] << 24) |
@@ -123,7 +123,7 @@ static int s302m_decode_frame(AVCodecContext *avctx, void *data,
(ff_reverse[buf[3] & 0x0f] << 4);
buf += 7;
}
- } else if (avctx->bits_per_coded_sample == 20) {
+ } else if (avctx->bits_per_raw_sample == 20) {
uint32_t *o = (uint32_t *)frame->data[0];
for (; buf_size > 5; buf_size -= 6) {
*o++ = (ff_reverse[buf[2] & 0xf0] << 28) |