[xiph-commits] r16365 - trunk/ffmpeg2theora/src

j at svn.xiph.org j at svn.xiph.org
Fri Jul 31 02:07:07 PDT 2009


Author: j
Date: 2009-07-31 02:07:07 -0700 (Fri, 31 Jul 2009)
New Revision: 16365

Modified:
   trunk/ffmpeg2theora/src/ffmpeg2theora.c
Log:
refine json output on error

Modified: trunk/ffmpeg2theora/src/ffmpeg2theora.c
===================================================================
--- trunk/ffmpeg2theora/src/ffmpeg2theora.c	2009-07-31 08:56:18 UTC (rev 16364)
+++ trunk/ffmpeg2theora/src/ffmpeg2theora.c	2009-07-31 09:07:07 UTC (rev 16365)
@@ -2486,7 +2486,9 @@
             }
             else{
                 if (info.frontend)
-                    fprintf(info.frontend, "{\"result\": \"input format not suported.\"}\n");
+                    fprintf(info.frontend, "{\"code\": \"basfile\", \"input format not supported.\"}\n");
+                else if (output_json)
+                    fprintf(stdout, "{\"code\": \"basfile\", \"input format not supported.\"}\n");
                 else
                     fprintf(stderr,"\nUnable to decode input.\n");
                 return(1);
@@ -2495,7 +2497,9 @@
         }
         else{
             if (info.frontend)
-                fprintf(info.frontend, "{\"result\": \"file does not exist or has unknown data format.\"}\n");
+                fprintf(info.frontend, "{\"code\": \"basfile\", \"file does not exist or has unknown data format.\"}\n");
+            else if (output_json)
+                fprintf(stdout, "{\"code\": \"basfile\", \"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);



More information about the commits mailing list