Commit 3a1afc55 authored by Julian Rother's avatar Julian Rother

Added json_filenifo function

parent 78fe819e
......@@ -77,6 +77,7 @@ int main(int argc, char *argv[])
if (rename(tmp, path))
job_failed("Overwriting output file failed: %s", strerror(errno));
unlink(tmp);
ping_job(jobid, "finished", "{\"log\": \"%s\"}", jescape(get_avlogbuf()));
ping_job(jobid, "finished", "{%s, \"log\": \"%s\"}", json_fileinfo(path),
jescape(get_avlogbuf()));
return 0;
}
......@@ -359,7 +359,7 @@ int main(int argc, char *argv[])
if (rename(tmppath, outpath))
job_failed("Overwriting output file \"%s\" failed: %s", outpath, strerror(errno));
unlink(tmppath);
ping_job(jobid, "finished", "{\"hash\": \"%s\", \"duration\": %f, \"filesize\": %i, \"log\": \"%s\"}",
hashfile(outpath), fileduration(outpath), filesize(outpath), jescape(get_avlogbuf()));
ping_job(jobid, "finished", "{%s, \"log\": \"%s\"}", json_fileinfo(outpath),
jescape(get_avlogbuf()));
return 0;
}
......@@ -15,6 +15,7 @@ void *xmalloc(size_t size);
char *hashfile(char *path);
double fileduration(char *path);
size_t filesize(char *path);
char *json_fileinfo(char *path);
/* JSON av parsing */
void parse_dict(AVDictionary **d, char *s);
......
#include "../util.h"
char *json_fileinfo(char *path)
{
return mprintf("\"hash\": \"%s\", \"duration\": %f, \"filesize\": %i",
hashfile(path), fileduration(path), filesize(path));
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment