summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/sbc/gstsbcdec.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/sbc/gstsbcdec.c b/ext/sbc/gstsbcdec.c
index 5031dd922..086fe1fc0 100644
--- a/ext/sbc/gstsbcdec.c
+++ b/ext/sbc/gstsbcdec.c
@@ -159,13 +159,13 @@ gst_sbc_dec_set_format (GstAudioDecoder * audio_dec, GstCaps * caps)
return FALSE;
if (strcmp (channel_mode, "mono") == 0) {
- dec->frame_len = 4 + (subbands * 1) / 2 + (blocks * 1 * bitpool) / 8;
+ dec->frame_len = 4 + (subbands * 1) / 2 + ((blocks * 1 * bitpool) + 7) / 8;
} else if (strcmp (channel_mode, "dual") == 0) {
- dec->frame_len = 4 + (subbands * 2) / 2 + (blocks * 2 * bitpool) / 8;
+ dec->frame_len = 4 + (subbands * 2) / 2 + ((blocks * 2 * bitpool) + 7) / 8;
} else if (strcmp (channel_mode, "stereo") == 0) {
- dec->frame_len = 4 + (subbands * 2) / 2 + (blocks * bitpool) / 8;
+ dec->frame_len = 4 + (subbands * 2) / 2 + ((blocks * bitpool) + 7) / 8;
} else if (strcmp (channel_mode, "joint") == 0) {
- dec->frame_len = 4 + (subbands * 2) / 2 + (subbands + blocks * bitpool) / 8;
+ dec->frame_len = 4 + (subbands * 2) / 2 + ((subbands + blocks * bitpool) + 7) / 8;
} else {
return FALSE;
}