summaryrefslogtreecommitdiff
path: root/drivers/opus/opus_multistream_decoder.c
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2016-05-03 19:14:24 +0200
committerRémi Verschelde <remi@verschelde.fr>2016-05-03 19:14:24 +0200
commitc90bc695447b5d74227ed7c0d0bc19b7141dc835 (patch)
tree808af09d82e51698b9b7ba18795ba3a210a1d8f0 /drivers/opus/opus_multistream_decoder.c
parent4e23ba5f37e21021c47e3aecf544afc9485e311b (diff)
parent7c59d819a7ebb936d51ca032e66a2489e4080d08 (diff)
Merge pull request #4532 from vnen/pr-update-opus-1.1.2
Update Opus driver to 1.1.2
Diffstat (limited to 'drivers/opus/opus_multistream_decoder.c')
-rw-r--r--drivers/opus/opus_multistream_decoder.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/opus/opus_multistream_decoder.c b/drivers/opus/opus_multistream_decoder.c
index 43c695d815..25100edba2 100644
--- a/drivers/opus/opus_multistream_decoder.c
+++ b/drivers/opus/opus_multistream_decoder.c
@@ -24,10 +24,7 @@
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-
-#ifdef OPUS_ENABLED
#include "opus/opus_config.h"
-#endif
#include "opus/opus_multistream.h"
#include "opus/opus.h"
@@ -75,7 +72,7 @@ int opus_multistream_decoder_init(
char *ptr;
if ((channels>255) || (channels<1) || (coupled_streams>streams) ||
- (coupled_streams+streams>255) || (streams<1) || (coupled_streams<0))
+ (streams<1) || (coupled_streams<0) || (streams>255-coupled_streams))
return OPUS_BAD_ARG;
st->layout.nb_channels = channels;
@@ -119,7 +116,7 @@ OpusMSDecoder *opus_multistream_decoder_create(
int ret;
OpusMSDecoder *st;
if ((channels>255) || (channels<1) || (coupled_streams>streams) ||
- (coupled_streams+streams>255) || (streams<1) || (coupled_streams<0))
+ (streams<1) || (coupled_streams<0) || (streams>255-coupled_streams))
{
if (error)
*error = OPUS_BAD_ARG;
@@ -317,7 +314,7 @@ static void opus_copy_channel_out_float(
if (src != NULL)
{
for (i=0;i<frame_size;i++)
-#if defined(OPUS_FIXED_POINT)
+#if defined(FIXED_POINT)
float_dst[i*dst_stride+dst_channel] = (1/32768.f)*src[i*src_stride];
#else
float_dst[i*dst_stride+dst_channel] = src[i*src_stride];
@@ -346,7 +343,7 @@ static void opus_copy_channel_out_short(
if (src != NULL)
{
for (i=0;i<frame_size;i++)
-#if defined(OPUS_FIXED_POINT)
+#if defined(FIXED_POINT)
short_dst[i*dst_stride+dst_channel] = src[i*src_stride];
#else
short_dst[i*dst_stride+dst_channel] = FLOAT2INT16(src[i*src_stride]);