aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2020-03-11 21:50:02 +0100
committerPaul B Mahol <onemda@gmail.com>2020-03-11 21:54:27 +0100
commit2c08cd284dd1d630a69080f34c58ad41007d5855 (patch)
tree7f76b4c4d3bd313115731978782c05be6c393bae
parent9a13ed522f361cdc3fa424922d59aca214d55a15 (diff)
downloadffmpeg-2c08cd284dd1d630a69080f34c58ad41007d5855.tar.gz
avcodec/wavpack: fix some syle issues
-rw-r--r--libavcodec/wavpack.c38
1 files changed, 20 insertions, 18 deletions
diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c
index bb36f43269..0326f15cd6 100644
--- a/libavcodec/wavpack.c
+++ b/libavcodec/wavpack.c
@@ -596,8 +596,8 @@ static int wv_unpack_dsd_fast(WavpackFrameContext *s, uint8_t *dst_left, uint8_t
max_probability = bytestream2_get_byte(&s->gbyte);
if (max_probability < 0xff) {
- uint8_t *outptr = (uint8_t *) s->probabilities;
- uint8_t *outend = outptr + sizeof (*s->probabilities) * history_bins;
+ uint8_t *outptr = (uint8_t *)s->probabilities;
+ uint8_t *outend = outptr + sizeof(*s->probabilities) * history_bins;
while (outptr < outend && bytestream2_get_bytes_left(&s->gbyte)) {
int code = bytestream2_get_byte(&s->gbyte);
@@ -618,9 +618,9 @@ static int wv_unpack_dsd_fast(WavpackFrameContext *s, uint8_t *dst_left, uint8_t
if (outptr < outend ||
(bytestream2_get_bytes_left(&s->gbyte) && bytestream2_get_byte(&s->gbyte)))
return AVERROR_INVALIDDATA;
- } else if (bytestream2_get_bytes_left(&s->gbyte) > (int) sizeof (*s->probabilities) * history_bins) {
- bytestream2_get_buffer(&s->gbyte, (uint8_t *) s->probabilities,
- sizeof (*s->probabilities) * history_bins);
+ } else if (bytestream2_get_bytes_left(&s->gbyte) > (int)sizeof(*s->probabilities) * history_bins) {
+ bytestream2_get_buffer(&s->gbyte, (uint8_t *)s->probabilities,
+ sizeof(*s->probabilities) * history_bins);
} else {
return AVERROR_INVALIDDATA;
}
@@ -1023,7 +1023,7 @@ static av_cold int wavpack_decode_init(AVCodecContext *avctx)
s->prev_frame.f = av_frame_alloc();
// the DSD to PCM context is shared (and used serially) between all decoding threads
- s->dsdctx = av_calloc(avctx->channels, sizeof (DSDContext));
+ s->dsdctx = av_calloc(avctx->channels, sizeof(DSDContext));
if (!s->curr_frame.f || !s->prev_frame.f || !s->dsdctx)
return AVERROR(ENOMEM);
@@ -1505,28 +1505,30 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no,
if (s->stereo_in) {
if (got_dsd) {
- if (dsd_mode == 3)
+ if (dsd_mode == 3) {
ret = wv_unpack_dsd_high(s, samples_l, samples_r);
- else if (dsd_mode == 1)
+ } else if (dsd_mode == 1) {
ret = wv_unpack_dsd_fast(s, samples_l, samples_r);
- else
+ } else {
ret = wv_unpack_dsd_copy(s, samples_l, samples_r);
- }
- else
+ }
+ } else {
ret = wv_unpack_stereo(s, &s->gb, samples_l, samples_r, avctx->sample_fmt);
+ }
if (ret < 0)
return ret;
} else {
if (got_dsd) {
- if (dsd_mode == 3)
+ if (dsd_mode == 3) {
ret = wv_unpack_dsd_high(s, samples_l, NULL);
- else if (dsd_mode == 1)
+ } else if (dsd_mode == 1) {
ret = wv_unpack_dsd_fast(s, samples_l, NULL);
- else
+ } else {
ret = wv_unpack_dsd_copy(s, samples_l, NULL);
- }
- else
+ }
+ } else {
ret = wv_unpack_mono(s, &s->gb, samples_l, avctx->sample_fmt);
+ }
if (ret < 0)
return ret;
@@ -1553,8 +1555,8 @@ static int dsd_channel(AVCodecContext *avctx, void *frmptr, int jobnr, int threa
AVFrame *frame = frmptr;
ff_dsd2pcm_translate (&s->dsdctx [jobnr], s->samples, 0,
- (uint8_t *) frame->extended_data[jobnr], 4,
- (float *) frame->extended_data[jobnr], 1);
+ (uint8_t *)frame->extended_data[jobnr], 4,
+ (float *)frame->extended_data[jobnr], 1);
return 0;
}