aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/alac.c
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2015-09-06 10:44:11 +0200
committerHendrik Leppkes <h.leppkes@gmail.com>2015-09-06 16:25:55 +0200
commiteb011f73ca2f7dc51576c5bd006004dcfc7dfb69 (patch)
treeb7cb5b72da3c50340b4643c0ef5c47edce8b01d6 /libavcodec/alac.c
parentc5406d5e150344f8aea092afd6d9e552b3be1ac9 (diff)
downloadffmpeg-eb011f73ca2f7dc51576c5bd006004dcfc7dfb69.tar.gz
avcodec/alac: remove dead code cruft
The output is always planar since two major bumps, remove all code related to packed output.
Diffstat (limited to 'libavcodec/alac.c')
-rw-r--r--libavcodec/alac.c40
1 files changed, 3 insertions, 37 deletions
diff --git a/libavcodec/alac.c b/libavcodec/alac.c
index 13607b3e2c..827c0db191 100644
--- a/libavcodec/alac.c
+++ b/libavcodec/alac.c
@@ -404,7 +404,6 @@ static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index,
alac->extra_bits, channels, alac->nb_samples);
}
- if(av_sample_fmt_is_planar(avctx->sample_fmt)) {
switch(alac->sample_size) {
case 16: {
for (ch = 0; ch < channels; ch++) {
@@ -420,37 +419,6 @@ static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index,
}}
break;
}
- }else{
- switch(alac->sample_size) {
- case 16: {
- int16_t *outbuffer = ((int16_t *)frame->extended_data[0]) + ch_index;
- for (i = 0; i < alac->nb_samples; i++) {
- for (ch = 0; ch < channels; ch++)
- *outbuffer++ = alac->output_samples_buffer[ch][i];
- outbuffer += alac->channels - channels;
- }
- }
- break;
- case 24: {
- int32_t *outbuffer = ((int32_t *)frame->extended_data[0]) + ch_index;
- for (i = 0; i < alac->nb_samples; i++) {
- for (ch = 0; ch < channels; ch++)
- *outbuffer++ = alac->output_samples_buffer[ch][i] << 8;
- outbuffer += alac->channels - channels;
- }
- }
- break;
- case 32: {
- int32_t *outbuffer = ((int32_t *)frame->extended_data[0]) + ch_index;
- for (i = 0; i < alac->nb_samples; i++) {
- for (ch = 0; ch < channels; ch++)
- *outbuffer++ = alac->output_samples_buffer[ch][i];
- outbuffer += alac->channels - channels;
- }
- }
- break;
- }
- }
return 0;
}
@@ -544,7 +512,7 @@ static int allocate_buffers(ALACContext *alac)
FF_ALLOC_OR_GOTO(alac->avctx, alac->predict_error_buffer[ch],
buf_size, buf_alloc_fail);
- alac->direct_output = alac->sample_size > 16 && av_sample_fmt_is_planar(alac->avctx->sample_fmt);
+ alac->direct_output = alac->sample_size > 16;
if (!alac->direct_output) {
FF_ALLOC_OR_GOTO(alac->avctx, alac->output_samples_buffer[ch],
buf_size, buf_alloc_fail);
@@ -593,7 +561,6 @@ static int alac_set_info(ALACContext *alac)
static av_cold int alac_decode_init(AVCodecContext * avctx)
{
int ret;
- int req_packed;
ALACContext *alac = avctx->priv_data;
alac->avctx = avctx;
@@ -607,12 +574,11 @@ static av_cold int alac_decode_init(AVCodecContext * avctx)
return -1;
}
- req_packed = LIBAVCODEC_VERSION_MAJOR < 55 && !av_sample_fmt_is_planar(avctx->request_sample_fmt);
switch (alac->sample_size) {
- case 16: avctx->sample_fmt = req_packed ? AV_SAMPLE_FMT_S16 : AV_SAMPLE_FMT_S16P;
+ case 16: avctx->sample_fmt = AV_SAMPLE_FMT_S16P;
break;
case 24:
- case 32: avctx->sample_fmt = req_packed ? AV_SAMPLE_FMT_S32 : AV_SAMPLE_FMT_S32P;
+ case 32: avctx->sample_fmt = AV_SAMPLE_FMT_S32P;
break;
default: avpriv_request_sample(avctx, "Sample depth %d", alac->sample_size);
return AVERROR_PATCHWELCOME;