summaryrefslogtreecommitdiff
path: root/libavcodec/wavpack.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-05-28 10:02:56 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-05-28 10:03:04 +0200
commit84051d57f54f061cfb7b3abe1be556d09e2d13fb (patch)
tree28bd3176ee20ce2c31af71dbf3a5324c4040f5c6 /libavcodec/wavpack.c
parentbe72853f8aac459983739ad3a31ffad0ad7997cc (diff)
parenta7ec3a9a4eea4e374afcd6e05828b103e6fcb601 (diff)
Merge commit 'a7ec3a9a4eea4e374afcd6e05828b103e6fcb601'
* commit 'a7ec3a9a4eea4e374afcd6e05828b103e6fcb601': wavpack: drop redundant if/else blocks Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/wavpack.c')
-rw-r--r--libavcodec/wavpack.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c
index 4f89be3ae2..17a5afbc6f 100644
--- a/libavcodec/wavpack.c
+++ b/libavcodec/wavpack.c
@@ -1138,13 +1138,7 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no,
}
if (s->stereo_in) {
- if (avctx->sample_fmt == AV_SAMPLE_FMT_S16)
- samplecount = wv_unpack_stereo(s, &s->gb, samples, AV_SAMPLE_FMT_S16);
- else if (avctx->sample_fmt == AV_SAMPLE_FMT_S32)
- samplecount = wv_unpack_stereo(s, &s->gb, samples, AV_SAMPLE_FMT_S32);
- else
- samplecount = wv_unpack_stereo(s, &s->gb, samples, AV_SAMPLE_FMT_FLT);
-
+ samplecount = wv_unpack_stereo(s, &s->gb, samples, avctx->sample_fmt);
if (samplecount < 0)
return samplecount;
@@ -1152,13 +1146,7 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no,
} else {
const int channel_stride = avctx->channels;
- if (avctx->sample_fmt == AV_SAMPLE_FMT_S16)
- samplecount = wv_unpack_mono(s, &s->gb, samples, AV_SAMPLE_FMT_S16);
- else if (avctx->sample_fmt == AV_SAMPLE_FMT_S32)
- samplecount = wv_unpack_mono(s, &s->gb, samples, AV_SAMPLE_FMT_S32);
- else
- samplecount = wv_unpack_mono(s, &s->gb, samples, AV_SAMPLE_FMT_FLT);
-
+ samplecount = wv_unpack_mono(s, &s->gb, samples, avctx->sample_fmt);
if (samplecount < 0)
return samplecount;