shithub: opus-tools

Download patch

ref: c9d0ef50a1283d2a3be9c4572c35884e31308713
parent: 01cb2fe2805f0cd5c112a2028fcc5137e94acc57
author: Gregory Maxwell <[email protected]>
date: Thu Aug 9 06:53:00 EDT 2012

Avoid shadowing global symbol 'signal' on OSX.

On MacOS, stdlib.h ends up including sys/signal.h, generating
warnings about the local variables called 'signal' shadowing
the global symbol signal(3). So we avoid using that variable
name.

--- a/src/opusenc.c
+++ b/src/opusenc.c
@@ -262,7 +262,7 @@
   int                chan=2;
   int                with_hard_cbr=0;
   int                with_cvbr=0;
-  int                signal=OPUS_AUTO;
+  int                signaltype=OPUS_AUTO;
   int                expect_loss=0;
   int                complexity=10;
   int                downmix=0;
@@ -364,9 +364,9 @@
           inopt.rawmode=1;
           inopt.endianness=atoi(optarg);
         }else if(strcmp(long_options[option_index].name,"music")==0){
-          signal=OPUS_SIGNAL_MUSIC;
+          signaltype=OPUS_SIGNAL_MUSIC;
         }else if(strcmp(long_options[option_index].name,"speech")==0){
-          signal=OPUS_SIGNAL_VOICE;
+          signaltype=OPUS_SIGNAL_VOICE;
         }else if(strcmp(long_options[option_index].name,"downmix-mono")==0){
           downmix=1;
         }else if(strcmp(long_options[option_index].name,"downmix-stereo")==0){
@@ -579,7 +579,7 @@
     exit(1);
   }
 
-  ret=opus_multistream_encoder_ctl(st, OPUS_SET_SIGNAL(signal));
+  ret=opus_multistream_encoder_ctl(st, OPUS_SET_SIGNAL(signaltype));
   if(ret!=OPUS_OK){
     fprintf(stderr,"Error OPUS_SET_SIGNAL returned: %s\n",opus_strerror(ret));
     exit(1);