]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Improve debug messages a little
authorMike Brady <mikebrady@eircom.net>
Sun, 16 Apr 2017 17:40:05 +0000 (18:40 +0100)
committerMike Brady <mikebrady@eircom.net>
Sun, 16 Apr 2017 17:40:05 +0000 (18:40 +0100)
audio_sndio.c
player.c

index 8aa1d8ab3a5e8bfc79f12ed14c950ee9339ba90e..c10077c234cc04f0f88c146d367e07d3ef56148d 100644 (file)
@@ -229,12 +229,14 @@ static void onmove_cb(void *arg, int delta) {
 
 static int delay(long *_delay) {
   pthread_mutex_lock(&sndio_mutex);
-  if (played > (written / framesize)) {
+  // debug(1,"Frames written %u, played %u.",written/framesize,played);
+  
+  //if (played > (written / framesize)) {
     /* _delay is in frames */
     *_delay = (written / framesize) - played;
-  } else {
-    *_delay = 0;
-  }
// } else {
//   *_delay = 0;
// }
   pthread_mutex_unlock(&sndio_mutex);
   return 0;
 }
index 9f57e1c449879f2ca4dcf39ea127292ebc71c810..5dbce717487ddf2209fe7854547016230f3d13cc 100644 (file)
--- a/player.c
+++ b/player.c
@@ -1685,7 +1685,7 @@ static void *player_thread_func(void *arg) {
             current_delay = l_delay;
             if (resp == 0) { // no error
               if (current_delay < 0) {
-                debug(1, "Underrun of %d frames reported, but ignored.", current_delay);
+                debug(1, "Underrun of %lld frames reported, but ignored.", current_delay);
                 current_delay =
                     0; // could get a negative value if there was underrun, but ignore it.
               }
@@ -1728,7 +1728,7 @@ static void *player_thread_func(void *arg) {
 
             // only allow stuffing if there is enough time to do it -- check DAC buffer...
             if (current_delay < DAC_BUFFER_QUEUE_MINIMUM_LENGTH) {
-              // debug(1,"DAC buffer too short to allow stuffing.");
+              // debug(2,"DAC buffer too short(at %lld frames) to allow stuffing.",current_delay);
               amount_to_stuff = 0;
             }