[FFmpeg-cvslog] wavpack: drop redundant if/else blocks
Anton Khirnov
git at videolan.org
Tue May 28 10:07:12 CEST 2013
ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Sat May 25 07:49:25 2013 +0200| [a7ec3a9a4eea4e374afcd6e05828b103e6fcb601] | committer: Anton Khirnov
wavpack: drop redundant if/else blocks
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a7ec3a9a4eea4e374afcd6e05828b103e6fcb601
---
libavcodec/wavpack.c | 16 ++--------------
1 file changed, 2 insertions(+), 14 deletions(-)
diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c
index 7136e7a..4349ccb 100644
--- a/libavcodec/wavpack.c
+++ b/libavcodec/wavpack.c
@@ -1125,13 +1125,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;
@@ -1139,13 +1133,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;
More information about the ffmpeg-cvslog
mailing list