Ver código fonte

cmAudioPortAlsa.c : Included new snd_pcm_state value SND_PCM_STATE_PRIVATE1 in switch statements to eliminate warning.

master
kevin 4 anos atrás
pai
commit
29196253a7
1 arquivos alterados com 20 adições e 12 exclusões
  1. 20
    12
      linux/cmAudioPortAlsa.c

+ 20
- 12
linux/cmAudioPortAlsa.c Ver arquivo

@@ -340,15 +340,16 @@ const char* _cmApPcmStateToString( snd_pcm_state_t state )
340 340
 {
341 341
   switch( state )
342 342
   {
343
-  case SND_PCM_STATE_OPEN:         return "open";
344
-  case SND_PCM_STATE_SETUP:        return "setup";
345
-  case SND_PCM_STATE_PREPARED:     return "prepared";
346
-  case SND_PCM_STATE_RUNNING:      return "running";
347
-  case SND_PCM_STATE_XRUN:         return "xrun";
348
-  case SND_PCM_STATE_DRAINING:     return "draining";
349
-  case SND_PCM_STATE_PAUSED:       return "paused";
350
-  case SND_PCM_STATE_SUSPENDED:    return "suspended";
351
-  case SND_PCM_STATE_DISCONNECTED: return "disconnected";
343
+    case SND_PCM_STATE_OPEN:         return "open";
344
+    case SND_PCM_STATE_SETUP:        return "setup";
345
+    case SND_PCM_STATE_PREPARED:     return "prepared";
346
+    case SND_PCM_STATE_RUNNING:      return "running";
347
+    case SND_PCM_STATE_XRUN:         return "xrun";
348
+    case SND_PCM_STATE_DRAINING:     return "draining";
349
+    case SND_PCM_STATE_PAUSED:       return "paused";
350
+    case SND_PCM_STATE_SUSPENDED:    return "suspended";
351
+    case SND_PCM_STATE_DISCONNECTED: return "disconnected";
352
+    case SND_PCM_STATE_PRIVATE1:   return "private1";
352 353
 
353 354
   }
354 355
   return "<invalid>";
@@ -680,6 +681,7 @@ void _cmApStateRecover( snd_pcm_t* pcmH, cmApDevRecd_t* drp, bool inputFl  )
680 681
     case SND_PCM_STATE_DRAINING:
681 682
     case SND_PCM_STATE_PAUSED:
682 683
     case SND_PCM_STATE_DISCONNECTED:
684
+    case SND_PCM_STATE_PRIVATE1:
683 685
       //case SND_PCM_STATE_LAST:
684 686
       break;
685 687
   }
@@ -722,7 +724,7 @@ int _cmApWriteBuf( cmApDevRecd_t* drp, snd_pcm_t* pcmH, const cmApSample_t* sp,
722 724
   unsigned            byteCnt     = bytesPerSmp * smpCnt;
723 725
   const cmApSample_t* ep          = sp + smpCnt;
724 726
   char                obuf[ byteCnt ];
725
-
727
+  
726 728
   // if no output was given then fill the device buffer with zeros
727 729
   if( sp == NULL )
728 730
     memset(obuf,0,byteCnt);
@@ -743,7 +745,11 @@ int _cmApWriteBuf( cmApDevRecd_t* drp, snd_pcm_t* pcmH, const cmApSample_t* sp,
743 745
         {
744 746
           short* dp = (short*)obuf;
745 747
           while( sp < ep )
746
-            *dp++ = (short)(*sp++ * 0x7fff);        
748
+          {
749
+            *dp++ = (short)(*sp++ * 0x7fff);
750
+            
751
+          }
752
+            
747 753
         }
748 754
         break;
749 755
 
@@ -764,7 +770,8 @@ int _cmApWriteBuf( cmApDevRecd_t* drp, snd_pcm_t* pcmH, const cmApSample_t* sp,
764 770
           int* dp = (int*)obuf;
765 771
 
766 772
           while( sp < ep )
767
-            *dp++ = (int)(*sp++ * 0x7fffffff);        
773
+            *dp++ = (int)(*sp++ * 0x7fffffff);
774
+
768 775
 
769 776
 #ifdef IMPLUSE_FN
770 777
           int* tmp = (int*)obuf;
@@ -1049,6 +1056,7 @@ bool _cmApThreadFunc(void* param)
1049 1056
             case SND_PCM_STATE_DRAINING:
1050 1057
             case SND_PCM_STATE_PAUSED:
1051 1058
             case SND_PCM_STATE_DISCONNECTED:
1059
+            case SND_PCM_STATE_PRIVATE1:
1052 1060
               continue;
1053 1061
 
1054 1062
             case SND_PCM_STATE_RUNNING:

Carregando…
Cancelar
Salvar