X-Git-Url: http://git.zerfleddert.de/cgi-bin/gitweb.cgi/record-dvb/blobdiff_plain/dba12497cea20a96739be2fd80caa7427e20570b..6a3dc096fef9e1206f945640bd44ac3077096e54:/record-dvb.c diff --git a/record-dvb.c b/record-dvb.c index d32eba1..45d2fcb 100644 --- a/record-dvb.c +++ b/record-dvb.c @@ -40,7 +40,10 @@ void record(int(*open_fn)(char *), char *url, char *outfile, int duration) do { if ((bytes = recv(in, buffer, CHUNKSIZE, 0)) < 1) { /* TODO: Insert better connection-loss recovery here */ - in = (*open_fn)(url); + if ((in = (*open_fn)(url)) < 0) { + sleep(1); + continue; + } } written = 0; do { @@ -68,7 +71,7 @@ int main(int argc, char **argv) if (argc == 4) { url = argv[1]; - duration = atol(argv[2])*60; + duration = atoi(argv[2])*60; outfile = argv[3]; } else { fprintf(stderr,"Syntax: %s URL duration_in_minutes outfile\n", argv[0]);