]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Tiny changes
authorMke Brady <mikebrady@eircom.net>
Sat, 26 Dec 2015 15:14:01 +0000 (15:14 +0000)
committerMke Brady <mikebrady@eircom.net>
Sat, 26 Dec 2015 15:14:01 +0000 (15:14 +0000)
audio_alsa.c
player.c

index 64656ef35fa5a836ccfea2efc01c9b648fc864a0..b725d78a7212b611d642a1ad04fecd304ce3306b 100644 (file)
@@ -453,8 +453,12 @@ static void parameters(audio_parameters *info) {
 static void volume(double vol) {
   // debug(1,"Setting volume db to %f, for volume input of %f.",vol_setting/100,vol);
   set_volume = vol;
-  if (snd_mixer_selem_set_playback_dB_all(alsa_mix_elem, vol, -1) != 0)
-    die("Failed to set playback dB volume");
+  if (snd_mixer_selem_set_playback_dB_all(alsa_mix_elem, vol, 0) != 0) {
+    debug(1,"Can't set playback volume accurately to %f dB.",vol);
+    if (snd_mixer_selem_set_playback_dB_all(alsa_mix_elem, vol, -1) != 0)
+      if (snd_mixer_selem_set_playback_dB_all(alsa_mix_elem, vol, 1) != 0)
+        die("Failed to set playback dB volume");
+  }
 }
 
 static void linear_volume(double vol) {
index 5330f49d73ffcd97e947ab71a1c5d6003871923b..0b24a67eb4a62f69954c94a638c5f6596203ebbd 100644 (file)
--- a/player.c
+++ b/player.c
@@ -579,9 +579,8 @@ static abuf_t *buffer_get_frame(void) {
                  << 32) /
                     44100;
 
-            uint32_t filler_size = frame_size;
             uint32_t max_dac_delay = 4410;
-            filler_size = 4410; // 0.1 second -- the maximum we'll add to the DAC
+            uint32_t filler_size = max_dac_delay; // 0.1 second -- the maximum we'll add to the DAC
 
             if (local_time_now >= first_packet_time_to_play) {
               // we've gone past the time...