aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2017-03-29 12:04:46 +0200
committerLuca Barbato <lu_zero@gentoo.org>2017-03-29 22:56:54 +0200
commit6a9e331d79f8f78ba7642004ac13d744d033b98e (patch)
tree718b491c7cb5c74d6ad09f05be8a2b4f81d11a52
parente788ca05a796c97b84758189c83183f5ffa808f4 (diff)
downloadffmpeg-6a9e331d79f8f78ba7642004ac13d744d033b98e.tar.gz
dcadec: remove extra indirection
num_core_channels is always equal to s->audio_header.prim_channels, neither one of those variables ever get changed. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
-rw-r--r--libavcodec/dcadec.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/libavcodec/dcadec.c b/libavcodec/dcadec.c
index fa2a2400fe..ed1ed2d5f3 100644
--- a/libavcodec/dcadec.c
+++ b/libavcodec/dcadec.c
@@ -1263,9 +1263,10 @@ static int scan_for_extensions(AVCodecContext *avctx)
return ret;
}
-static int set_channel_layout(AVCodecContext *avctx, int channels, int num_core_channels)
+static int set_channel_layout(AVCodecContext *avctx, int channels)
{
DCAContext *s = avctx->priv_data;
+ int num_core_channels = s->audio_header.prim_channels;
int i;
if (s->amode < 16) {
@@ -1372,7 +1373,6 @@ static int dca_decode_frame(AVCodecContext *avctx, void *data,
int buf_size = avpkt->size;
int lfe_samples;
- int num_core_channels = 0;
int i, ret;
float **samples_flt;
DCAContext *s = avctx->priv_data;
@@ -1406,9 +1406,6 @@ static int dca_decode_frame(AVCodecContext *avctx, void *data,
}
}
- /* record number of core channels incase less than max channels are requested */
- num_core_channels = s->audio_header.prim_channels;
-
if (s->ext_coding)
s->core_ext_mask = dca_ext_audio_descr_mask[s->ext_descr];
else
@@ -1420,7 +1417,7 @@ static int dca_decode_frame(AVCodecContext *avctx, void *data,
full_channels = channels = s->audio_header.prim_channels + !!s->lfe;
- ret = set_channel_layout(avctx, channels, num_core_channels);
+ ret = set_channel_layout(avctx, channels);
if (ret < 0)
return ret;
avctx->channels = channels;