]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Bring up to date with 3.3d2 from the raspberry pi
authorMike Brady <mikebrady@eircom.net>
Wed, 22 Aug 2018 13:41:03 +0000 (14:41 +0100)
committerMike Brady <mikebrady@eircom.net>
Wed, 22 Aug 2018 13:41:03 +0000 (14:41 +0100)
1  2 
audio_alsa.c
dacp.c
player.c
rtp.c

diff --cc audio_alsa.c
index ea6ab91f3f1d20e9b563cab41c39e08ae13bd71d,cee43e9db7e0c8f48772ab9df48d11958329b429..1abc296195911e63c287767e4112dcf2578c41d7
@@@ -882,8 -882,12 +882,14 @@@ int delay(long *the_delay) 
          debug(1, "Error %d in delay(): \"%s\". Delay reported is %d frames.", reply,
                snd_strerror(reply), *the_delay);
          snd_pcm_recover(alsa_handle, reply, 1);
 +        frame_index = 0;
 +        measurement_data_is_valid = 0;
+       } else {
+         if (*the_delay == 0) {
+           // there's nothing in the pipeline, so we can't measure frame rate.
+           frame_index = 0; // we'll be starting over...
+           measurement_data_is_valid = 0;
+         }
        }
      } else {
        frame_index = 0; // we'll be starting over...
@@@ -985,10 -989,17 +991,17 @@@ static int play(void *buf, int samples
              debug(1, "Error %d in delay(): \"%s\". Delay reported is %d frames.", err2,
                    snd_strerror(err2), fl);
              snd_pcm_recover(alsa_handle, err2, 1);
 +            frame_index = 0;
 +            measurement_data_is_valid = 0;
+           } else {
+             if (fl == 0) {
+               // there's nothing in the pipeline, so we can't measure frame rate.
+               frame_index = 0; // we'll be starting over...
+               measurement_data_is_valid = 0;
+             }
            }
-           measurement_time = get_absolute_time_in_fp();
+           uint64_t tf = get_absolute_time_in_fp();
            frames_played_at_measurement_time = frames_sent_for_playing - fl;
            if (frame_index == start_measurement_from_this_frame) {
              frames_played_at_measurement_start_time = frames_played_at_measurement_time;
diff --cc dacp.c
index 81e7b5307509401d37c7cb39d7604e6bf38f2220,81e7b5307509401d37c7cb39d7604e6bf38f2220..314979159da3acd0c37d25771d0d03d8387b19ff
--- 1/dacp.c
--- 2/dacp.c
+++ b/dacp.c
@@@ -277,7 -277,7 +277,7 @@@ int dacp_send_command(const char *comma
              }
  
              if (http_iserror(&rt)) {
--              debug(1, "Error parsing data.");
++              debug(3, "Error parsing data.");
                free(response.body);
                response.body = NULL;
                response.malloced_size = 0;
diff --cc player.c
index 3c2a1c28b0583cbd7c49af5f17539726a413039c,bdc5ffe1375b648aedcd02841e1fd18f7591e06e..3f3fa505901f92ee4151c472afb59209de7e2d76
+++ b/player.c
@@@ -2096,10 -2107,13 +2107,20 @@@ void *player_thread_func(void *arg) 
              int64_t should_be_frame;
              local_time_to_frame(local_time_now, &should_be_frame, conn);
  
++<<<<<<< HEAD
 +            //if (abs(td_in_frames + rt - should_be_frame) > 10 * conn->output_sample_ratio)
 +            //  debug(1, "Difference between old and new frame number is %" PRId64 " frames.",
 +            //        td_in_frames + rt - should_be_frame);
 +            
++=======
+             int64_t absolute_difference_in_frames = td_in_frames + rt - should_be_frame;
+             if (absolute_difference_in_frames < 0)
+               absolute_difference_in_frames = -absolute_difference_in_frames;
+             if (absolute_difference_in_frames > 10 * conn->output_sample_ratio)
+               debug(1, "Difference between old and new frame number is %" PRId64 " frames.",
+                     td_in_frames + rt - should_be_frame);
++>>>>>>> 347e63ba906e80bfc01596bacfbd18fbe0b6f940
              // this is the actual delay, including the latency we actually want, which will
              // fluctuate a good bit about a potentially rising or falling trend.
  
diff --cc rtp.c
Simple merge