Commit c7ac4419 authored by Jan Gerber's avatar Jan Gerber
Browse files

output valid json for errors, depend on 1.1.0 to work with current theora trunk

parent d0ebd89c
......@@ -107,7 +107,7 @@ if not conf.CheckPKGConfig(pkgconfig_version):
print 'pkg-config >= %s not found.' % pkgconfig_version
Exit(1)
XIPH_LIBS="ogg >= 1.1 vorbis vorbisenc theoradec >= 1.1beta1 theoraenc >= 1.1beta1"
XIPH_LIBS="ogg >= 1.1 vorbis vorbisenc theoradec >= 1.1.0 theoraenc >= 1.1.0"
if not conf.CheckPKG(XIPH_LIBS):
print 'some xiph libs are missing, ffmpeg2theora depends on %s' % XIPH_LIBS
......
......@@ -2537,7 +2537,7 @@ int main(int argc, char **argv) {
(double) convert->context->start_time / AV_TIME_BASE;
if (info.twopass!=1 && !info.outfile) {
if (info.frontend)
fprintf(info.frontend, "\"{result\": \"Unable to open output file.\"}\n");
fprintf(info.frontend, "{\"code\": \"badfile\", \"error\":\"Unable to open output file.\"}\n");
else
fprintf(stderr,"\nUnable to open output file `%s'.\n", outputfile_name);
return(1);
......@@ -2552,9 +2552,9 @@ int main(int argc, char **argv) {
}
else{
if (info.frontend)
fprintf(info.frontend, "{\"code\": \"badfile\", \"input format not supported.\"}\n");
fprintf(info.frontend, "{\"code\": \"badfile\", \"error\":\"input format not supported.\"}\n");
else if (output_json)
fprintf(stdout, "{\"code\": \"badfile\", \"input format not supported.\"}\n");
fprintf(stdout, "{\"code\": \"badfile\", \"error\":\"input format not supported.\"}\n");
else
fprintf(stderr,"\nUnable to decode input.\n");
return(1);
......@@ -2563,9 +2563,9 @@ int main(int argc, char **argv) {
}
else{
if (info.frontend)
fprintf(info.frontend, "{\"code\": \"badfile\", \"file does not exist or has unknown data format.\"}\n");
fprintf(info.frontend, "{\"code\": \"badfile\", \"error\":\"file does not exist or has unknown data format.\"}\n");
else if (output_json)
fprintf(stdout, "{\"code\": \"badfile\", \"file does not exist or has unknown data format.\"}\n");
fprintf(stdout, "{\"code\": \"badfile\", \"error\":\"file does not exist or has unknown data format.\"}\n");
else
fprintf(stderr, "\nFile `%s' does not exist or has an unknown data format.\n", inputfile_name);
return(1);
......
Supports Markdown
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