]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Use a parameter rather than a hard-wired input rate.
authorMike Brady <mikebrady@eircom.net>
Sun, 21 Oct 2018 15:31:55 +0000 (16:31 +0100)
committerMike Brady <mikebrady@eircom.net>
Sun, 21 Oct 2018 15:31:55 +0000 (16:31 +0100)
rtp.c

diff --git a/rtp.c b/rtp.c
index 599d5a489c6cccafc71fbd4236b9e3842e556499..e2c8f944dfeb7de422ef02e11cfc5521078f56de 100644 (file)
--- a/rtp.c
+++ b/rtp.c
@@ -1074,7 +1074,7 @@ int frame_to_local_time(uint32_t timestamp, uint64_t *time, rtsp_conn_info *conn
   uint64_t timestamp_interval_time;
   uint64_t remote_time_of_timestamp;
   uint32_t timestamp_interval = rtp_frame_offset(conn->reference_timestamp,timestamp);
-  if (timestamp_interval <= 44100*10) { // i.e. timestamp was really after the reference timestamp
+  if (timestamp_interval <= conn->input_rate*10) { // i.e. timestamp was really after the reference timestamp
     timestamp_interval_time =
         (timestamp_interval * time_difference) /
         (frame_difference);                             // this is the nominal time, based on the