From 657d048dbd935b019e08009cb337ea999d762e83 Mon Sep 17 00:00:00 2001 From: michael Date: Sat, 1 Jul 2006 22:54:16 +0000 Subject: [PATCH] defines --- record-dvb.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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 { -- 2.39.2