]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Fix calculation of initial delay
authorMike Brady <mikebrady@eircom.net>
Tue, 25 Feb 2020 14:44:13 +0000 (14:44 +0000)
committerMike Brady <mikebrady@eircom.net>
Tue, 25 Feb 2020 14:44:13 +0000 (14:44 +0000)
player.c

index 0e2a9956f0469edf9c4fb131aeb662827ca77e29..483fbee8d4735bffa5fe02fdc2a84563b101b0fa 100644 (file)
--- a/player.c
+++ b/player.c
@@ -1137,8 +1137,7 @@ static abuf_t *buffer_get_frame(rtsp_conn_info *conn) {
                     resp = config.output->delay(&dac_delay);
                   if (resp == 0) {
                     int64_t gross_frame_gap =
-                        ((conn->first_packet_time_to_play - local_time_now) * config.output_rate) >>
-                        32;
+                        ((conn->first_packet_time_to_play - local_time_now) * config.output_rate) / 1000000000;
                     int64_t exact_frame_gap = gross_frame_gap - dac_delay;
                     // debug(1,"Exact and gross frame gaps are %" PRId64 " and %" PRId64 " frames,
                     // and the dac delay is %ld.", exact_frame_gap, gross_frame_gap, dac_delay);