summaryrefslogtreecommitdiff
path: root/markad-standalone.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'markad-standalone.cpp')
-rw-r--r--markad-standalone.cpp37
1 files changed, 19 insertions, 18 deletions
diff --git a/markad-standalone.cpp b/markad-standalone.cpp
index 34235f3..3bd71bb 100644
--- a/markad-standalone.cpp
+++ b/markad-standalone.cpp
@@ -169,7 +169,7 @@ bool cMarkAdStandalone::ProcessFile(const char *Directory, int Number)
CheckIndex(Directory);
if (abort) return false;
- int datalen=385024;
+ const int datalen=385024;
uchar data[datalen];
char *fbuf;
@@ -784,21 +784,6 @@ cMarkAdStandalone::cMarkAdStandalone(const char *Directory, bool BackupMarks, in
isyslog("starting v%s",VERSION);
isyslog("on %s",Directory);
- if (!noPid)
- {
- CreatePidfile(Directory);
- if (abort)
- {
- video_demux=NULL;
- ac3_demux=NULL;
- mp2_demux=NULL;
- decoder=NULL;
- video=NULL;
- audio=NULL;
- return;
- }
- }
-
if (!bDecodeAudio)
{
isyslog("audio decoding disabled by user");
@@ -827,6 +812,21 @@ cMarkAdStandalone::cMarkAdStandalone(const char *Directory, bool BackupMarks, in
return;
}
+ if (!noPid)
+ {
+ CreatePidfile(Directory);
+ if (abort)
+ {
+ video_demux=NULL;
+ ac3_demux=NULL;
+ mp2_demux=NULL;
+ decoder=NULL;
+ video=NULL;
+ audio=NULL;
+ return;
+ }
+ }
+
if (isTS)
{
if (!CheckPATPMT(Directory))
@@ -1362,8 +1362,9 @@ int main(int argc, char *argv[])
pid_t pid = fork();
if (pid < 0)
{
- fprintf(stderr, "%m\n");
- esyslog("fork ERROR: %m");
+ char *err=strerror(errno);
+ fprintf(stderr, "%s\n",err);
+ esyslog("fork ERROR: %s",err);
return 2;
}
if (pid != 0)