]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Add initial support for U8 and S8 formats
authorMike Brady <mikebrady@eircom.net>
Sat, 10 Sep 2016 17:59:53 +0000 (18:59 +0100)
committerMike Brady <mikebrady@eircom.net>
Sat, 10 Sep 2016 17:59:53 +0000 (18:59 +0100)
audio_alsa.c

index c736e205b130c63e4f00d84d3231ae29678f7c53..348a0d1f8c3f503c4d7be07ed28f7124e0a3f0fe 100644 (file)
@@ -206,7 +206,7 @@ static int init(int argc, char **argv) {
         die("Invalid disable_synchronization option choice \"%s\". It should be \"yes\" or \"no\"");
     }
     
-    /* Get the output format, using the same names as aplay does -- S16_LE, S32_LE to begin with*/
+    /* Get the output format, using the same names as aplay does*/
     if (config_lookup_string(config.cfg, "alsa.output_format", &str)) {
       if (strcasecmp(str, "S16_LE") == 0)
         config.output_format = SND_PCM_FORMAT_S16_LE;
@@ -214,8 +214,12 @@ static int init(int argc, char **argv) {
         config.output_format = SND_PCM_FORMAT_S24_LE;
       else if (strcasecmp(str, "S32_LE") == 0)
         config.output_format = SND_PCM_FORMAT_S32_LE;
+      else if (strcasecmp(str, "U8") == 0)
+        config.output_format = SPS_FORMAT_U8;
+      else if (strcasecmp(str, "S8") == 0)
+        config.output_format = SPS_FORMAT_S8;
       else
-        die("Invalid output format \"%s\". It should be \"S16_LE\", \"S24_LE\" or \"S32_LE\"",str);
+        die("Invalid output format \"%s\". It should be \"U8\", \"S8\", \"S16_LE\", \"S24_LE\" or \"S32_LE\"",str);
     }
 
     /* Get the output rate, which must be a multiple of 44,100*/