chiark / gitweb /
get-volume shouldn't corrupt the volume!
[disorder] / server / server.c
index 345c2ca48d007fd6cf1a5d7f1b7627d15cf0c08d..b00a70e69af29820c5531274f313bb8fbb3a4828 100644 (file)
@@ -829,7 +829,7 @@ static int c_volume(struct conn *c,
     sink_writes(ev_writer_sink(c->w), "550 error accessing mixer\n");
     return 1;
   }
-  api->set_volume(&l, &r);
+  (set ? api->set_volume : api->get_volume)(&l, &r);
   sink_printf(ev_writer_sink(c->w), "252 %d %d\n", l, r);
   if(l != volume_left || r != volume_right) {
     volume_left = l;