Skip to content

Commit

Permalink
Redefine timeout to be an int rather than a 64-bit int. Bump to 2.1.10
Browse files Browse the repository at this point in the history
  • Loading branch information
mikebrady committed Nov 14, 2014
1 parent f4d47dc commit ffb37d2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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], [[email protected]])
AC_INIT([shairport-sync], [2.1.10], [[email protected]])
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([shairport.c])
AC_CONFIG_HEADERS([config.h])
Expand Down
3 changes: 2 additions & 1 deletion player.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ffb37d2

Please sign in to comment.