From ffb37d2b53a4edac7d38b5cc7abb19159830cfef Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Fri, 14 Nov 2014 16:53:14 +0000 Subject: [PATCH] Redefine timeout to be an int rather than a 64-bit int. Bump to 2.1.10 --- common.h | 2 +- configure.ac | 2 +- player.c | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/common.h b/common.h index ddbd1b54..11f15b73 100644 --- a/common.h +++ b/common.h @@ -44,7 +44,7 @@ typedef struct { uint8_t hw_addr[6]; int port; int resyncthreshold; // if it get's out of whack my more than this, resync. Zero means never resync. - uint64_t timeout; // while in play mode, exit if no packets of audio come in for more than this number of seconds . Zero means never exit. + int timeout; // while in play mode, exit if no packets of audio come in for more than this number of seconds . Zero means never exit. char *output_name; audio_output *output; char *mdns_name; diff --git a/configure.ac b/configure.ac index 3d807d85..1fe9b4d3 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.50]) -AC_INIT([shairport-sync], [2.1.9], [mikebrady@eircom.net]) +AC_INIT([shairport-sync], [2.1.10], [mikebrady@eircom.net]) AM_INIT_AUTOMAKE AC_CONFIG_SRCDIR([shairport.c]) AC_CONFIG_HEADERS([config.h]) diff --git a/player.c b/player.c index f9341936..d11e61c0 100644 --- a/player.c +++ b/player.c @@ -409,7 +409,8 @@ static abuf_t *buffer_get_frame(void) { // if config.timeout (default 120) seconds have elapsed since the last audio packet was received, then we should stop. // config.timeout of zero means don't check..., but iTunes may be confused by a long gap followed by a resumption... if ((time_of_last_audio_packet!=0) && (shutdown_requested==0) && (config.timeout!=0)) { - if (local_time_now-time_of_last_audio_packet>=config.timeout<<32) { + uint64_t ct = config.timeout; // go from int to 64-bit int + if (local_time_now-time_of_last_audio_packet>=ct<<32) { debug(1,"As Yeats almost said, \"Too long a silence / can make a stone of the heart\""); rtsp_request_shutdown_stream(); shutdown_requested=1;