chiark / gitweb /
Don't look up before/after code points more than once in word boundary
[disorder] / lib / uaudio-oss.c
index 081e1eb4bef09c6b595706cc57f816b7a4c223f5..6d902cb60108225a77c4624dce52c7a1cfafe250 100644 (file)
@@ -32,6 +32,7 @@
 #include "mem.h"
 #include "log.h"
 #include "uaudio.h"
+#include "configuration.h"
 
 #ifndef AFMT_U16_NE
 # if BYTE_ORDER == BIG_ENDIAN
@@ -127,13 +128,15 @@ static void oss_start(uaudio_callback *callback,
   /* Very specific buffer size requirements here apparently */
   uaudio_thread_start(callback, userdata, oss_play, 
                       4608 / uaudio_sample_size,
-                      4608 / uaudio_sample_size);
+                      4608 / uaudio_sample_size,
+                      0);
 #else
   /* We could SNDCTL_DSP_GETBLKSIZE but only when the device is already open,
    * which is kind of inconvenient.  We go with 1-4Kbyte for now. */
   uaudio_thread_start(callback, userdata, oss_play, 
                       32 / uaudio_sample_size,
-                      4096 / uaudio_sample_size);
+                      4096 / uaudio_sample_size,
+                      0);
 #endif
 }
 
@@ -195,6 +198,12 @@ static void oss_set_volume(int *left, int *right) {
   }
 }
 
+static void oss_configure(void) {
+  uaudio_set("device", config->device);
+  uaudio_set("mixer-device", config->mixer);
+  uaudio_set("mixer-channel", config->channel);
+}
+
 const struct uaudio uaudio_oss = {
   .name = "oss",
   .options = oss_options,
@@ -206,6 +215,7 @@ const struct uaudio uaudio_oss = {
   .close_mixer = oss_close_mixer,
   .get_volume = oss_get_volume,
   .set_volume = oss_set_volume,
+  .configure = oss_configure,
 };
 
 #endif