Commit e98f1f50 authored by Gregory Maxwell's avatar Gregory Maxwell
Browse files

Fix C89 incompatible mixed declarations and code introduced by 220a7d4b.

parent 49979211
......@@ -126,13 +126,14 @@ int opus_decoder_init(OpusDecoder *st, opus_int32 Fs, int channels)
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)
*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)
......
......@@ -359,6 +359,7 @@ static void stereo_fade(const opus_val16 *in, opus_val16 *out, opus_val16 g1, op
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 @@ OpusEncoder *opus_encoder_create(opus_int32 Fs, int channels, int application, i
*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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment