chiark / gitweb /
Merge playlist branch against trunk to date.
[disorder] / server / speaker-alsa.c
index 41e53b24b971eaa211ff8753399a1d2610becc77..d10ec198b5b15845c8ddea8c8a4d7090cc3248cd 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder
  * Copyright (C) 2005, 2006, 2007 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * the Free Software Foundation, either version 3 of the License, or
  * (at your option) any later version.
  *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file server/speaker-alsa.c
  * @brief Support for @ref BACKEND_ALSA */
@@ -49,7 +47,6 @@ static void alsa_init(void) {
 static void log_params(snd_pcm_hw_params_t *hwparams,
                        snd_pcm_sw_params_t *swparams) {
   snd_pcm_uframes_t f;
-  unsigned u;
 
   return;                               /* too verbose */
   if(hwparams) {
@@ -60,14 +57,22 @@ static void log_params(snd_pcm_hw_params_t *hwparams,
     info("sw silence_size=%lu", (unsigned long)f);
     snd_pcm_sw_params_get_silence_threshold(swparams, &f);
     info("sw silence_threshold=%lu", (unsigned long)f);
-    snd_pcm_sw_params_get_sleep_min(swparams, &u);
-    info("sw sleep_min=%lu", (unsigned long)u);
+#if HAVE_SND_PCM_SW_PARAMS_GET_SLEEP_MIN
+    {
+      unsigned u;
+
+      snd_pcm_sw_params_get_sleep_min(swparams, &u);
+      info("sw sleep_min=%lu", (unsigned long)u);
+    }
+#endif
     snd_pcm_sw_params_get_start_threshold(swparams, &f);
     info("sw start_threshold=%lu", (unsigned long)f);
     snd_pcm_sw_params_get_stop_threshold(swparams, &f);
     info("sw stop_threshold=%lu", (unsigned long)f);
+#if HAVE_SND_PCM_SW_PARAMS_GET_XFER_ALIGN
     snd_pcm_sw_params_get_xfer_align(swparams, &f);
     info("sw xfer_align=%lu", (unsigned long)f);
+#endif
   }
 }