From: michael Date: Sat, 1 Jul 2006 22:54:16 +0000 (+0000) Subject: defines X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/record-dvb/commitdiff_plain/657d048dbd935b019e08009cb337ea999d762e83 defines --- diff --git a/record-dvb.c b/record-dvb.c index 38609a4..bb69447 100644 --- a/record-dvb.c +++ b/record-dvb.c @@ -13,8 +13,9 @@ #include "http.h" #include "mcast.h" -#define CHUNKSIZE 3000 -#define GTOD_INTERVAL 100 +#define CHUNKSIZE 3000 +#define GTOD_INTERVAL 100 +#define MAX_ERROR_SLEEP 60 void record(int(*open_fn)(char *), char *url, char *outfile, int duration) { @@ -44,9 +45,12 @@ void record(int(*open_fn)(char *), char *url, char *outfile, int duration) sleep(error_sleep); printf("Reconnecting... "); if ((in = (*open_fn)(url)) < 0) { - if (error_sleep < 60) + if (error_sleep < MAX_ERROR_SLEEP) error_sleep *= 2; + if (error_sleep > MAX_ERROR_SLEEP) + error_sleep = MAX_ERROR_SLEEP; + printf("failed\n"); continue; } else {