mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-29 05:40:23 -04:00
bluetooth: sbc: Reduce for-loop induced indentation in sbc_unpack_frame
This commit is contained in:
parent
00602537ba
commit
8c0cca7905
1 changed files with 22 additions and 18 deletions
|
|
@ -493,10 +493,16 @@ static int sbc_unpack_frame(const uint8_t *data, struct sbc_frame *frame,
|
|||
for (blk = 0; blk < frame->blocks; blk++) {
|
||||
for (ch = 0; ch < frame->channels; ch++) {
|
||||
for (sb = 0; sb < frame->subbands; sb++) {
|
||||
if (levels[ch][sb] > 0) {
|
||||
uint32_t shift =
|
||||
frame->scale_factor[ch][sb] +
|
||||
uint32_t shift;
|
||||
|
||||
if (levels[ch][sb] == 0) {
|
||||
frame->sb_sample[blk][ch][sb] = 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
shift = frame->scale_factor[ch][sb] +
|
||||
1 + SBCDEC_FIXED_EXTRA_BITS;
|
||||
|
||||
audio_sample = 0;
|
||||
for (bit = 0; bit < bits[ch][sb]; bit++) {
|
||||
if (consumed > len * 8)
|
||||
|
|
@ -511,8 +517,6 @@ static int sbc_unpack_frame(const uint8_t *data, struct sbc_frame *frame,
|
|||
frame->sb_sample[blk][ch][sb] = (int32_t)
|
||||
(((((uint64_t) audio_sample << 1) | 1) << shift) /
|
||||
levels[ch][sb]) - (1 << shift);
|
||||
} else
|
||||
frame->sb_sample[blk][ch][sb] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue