Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Video AG Infrastruktur
ffworker
Commits
3a1afc55
Commit
3a1afc55
authored
Nov 27, 2017
by
Julian Rother
Browse files
Added json_filenifo function
parent
78fe819e
Changes
4
Hide whitespace changes
Inline
Side-by-side
remux.c
View file @
3a1afc55
...
...
@@ -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
;
}
transcode.c
View file @
3a1afc55
...
...
@@ -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
;
}
util.h
View file @
3a1afc55
...
...
@@ -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
);
...
...
util/json_fileinfo.c
0 → 100644
View file @
3a1afc55
#include "../util.h"
char
*
json_fileinfo
(
char
*
path
)
{
return
mprintf
(
"
\"
hash
\"
:
\"
%s
\"
,
\"
duration
\"
: %f,
\"
filesize
\"
: %i"
,
hashfile
(
path
),
fileduration
(
path
),
filesize
(
path
));
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment