diff options
author | Jochen Dolze <vdr@dolze.de> | 2012-11-07 21:42:13 +0100 |
---|---|---|
committer | Jochen Dolze <vdr@dolze.de> | 2012-11-07 21:42:13 +0100 |
commit | 2b4dc83266f695fad394db97b0e47d618160a897 (patch) | |
tree | 9852973c828db6dd06d6dec4796bc6896b83e3bd /command/markad-standalone.cpp | |
parent | 561325258f91786599ac10cdacaf98ab15d3de96 (diff) | |
download | vdr-plugin-markad-2b4dc83266f695fad394db97b0e47d618160a897.tar.gz vdr-plugin-markad-2b4dc83266f695fad394db97b0e47d618160a897.tar.bz2 |
Added more debug info
Diffstat (limited to 'command/markad-standalone.cpp')
-rw-r--r-- | command/markad-standalone.cpp | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/command/markad-standalone.cpp b/command/markad-standalone.cpp index e4153e1..75a22f6 100644 --- a/command/markad-standalone.cpp +++ b/command/markad-standalone.cpp @@ -955,16 +955,29 @@ bool cMarkAdStandalone::ProcessFile(int Number) char *fbuf; if (isTS) { - if (asprintf(&fbuf,"%s/%05i.ts",directory,Number)==-1) return false; + if (asprintf(&fbuf,"%s/%05i.ts",directory,Number)==-1) { + esyslog("failed to allocate string, out of memory?"); + return false; + } } else { - if (asprintf(&fbuf,"%s/%03i.vdr",directory,Number)==-1) return false; + if (asprintf(&fbuf,"%s/%03i.vdr",directory,Number)==-1) { + esyslog("failed to allocate string, out of memory?"); + return false; + } } int f=open(fbuf,O_RDONLY); free(fbuf); - if (f==-1) return false; + if (f==-1) { + if (isTS) { + esyslog("failed to open %05i.ts",Number); + } else { + esyslog("failed to open %03i.vdr",Number); + } + return false; + } int dataread; dsyslog("processing file %05i",Number); @@ -972,6 +985,7 @@ bool cMarkAdStandalone::ProcessFile(int Number) int pframe=-1; demux->NewFile(); +again: while ((dataread=read(f,data,datalen))>0) { if (abort) break; @@ -1116,6 +1130,8 @@ bool cMarkAdStandalone::ProcessFile(int Number) return false; } } + if ((dataread==-1) && (errno==EINTR)) goto again; // i know this is ugly ;) + close(f); return true; } |