ref: e98f1f50032f09b196879eeec55ad42200eefd1a
parent: 49979211180d4ceef59146405f5685d550323677
author: Gregory Maxwell <[email protected]>
date: Tue Oct 4 21:59:28 EDT 2011
Fix C89 incompatible mixed declarations and code introduced by 220a7d4b.
--- a/src/opus_decoder.c
+++ b/src/opus_decoder.c
@@ -126,6 +126,7 @@
OpusDecoder *opus_decoder_create(opus_int32 Fs, int channels, int *error)
{
int ret;
+ OpusDecoder *st;
if((Fs!=48000&&Fs!=24000&&Fs!=16000&&Fs!=12000&&Fs!=8000)||(channels!=1&&channels!=2))
{
if (error)
@@ -132,7 +133,7 @@
*error = OPUS_BAD_ARG;
return NULL;
}
- OpusDecoder *st = (OpusDecoder *)opus_alloc(opus_decoder_get_size(channels));
+ st = (OpusDecoder *)opus_alloc(opus_decoder_get_size(channels));
if (st == NULL)
{
if (error)
--- a/src/opus_encoder.c
+++ b/src/opus_encoder.c
@@ -359,6 +359,7 @@
OpusEncoder *opus_encoder_create(opus_int32 Fs, int channels, int application, int *error)
{
int ret;
+ OpusEncoder *st;
if((Fs!=48000&&Fs!=24000&&Fs!=16000&&Fs!=12000&&Fs!=8000)||(channels!=1&&channels!=2)||
(application != OPUS_APPLICATION_VOIP && application != OPUS_APPLICATION_AUDIO
&& application != OPUS_APPLICATION_RESTRICTED_LOWDELAY))
@@ -367,7 +368,7 @@
*error = OPUS_BAD_ARG;
return NULL;
}
- OpusEncoder *st = (OpusEncoder *)opus_alloc(opus_encoder_get_size(channels));
+ st = (OpusEncoder *)opus_alloc(opus_encoder_get_size(channels));
if (st == NULL)
{
if (error)