]> git.sesse.net Git - ffmpeg/blobdiff - ffprobe.c
cmdutils: make show_usage() use av_log()
[ffmpeg] / ffprobe.c
index ee3c899ce82279ed4b7a3411186f6bb1c4aa2f41..28e056390d29e886dbdc85efb58daea36c1ae4ad 100644 (file)
--- a/ffprobe.c
+++ b/ffprobe.c
@@ -178,9 +178,11 @@ static const AVClass writer_class = {
 
 static void writer_close(WriterContext **wctx)
 {
-    if (*wctx && (*wctx)->writer->uninit)
-        (*wctx)->writer->uninit(*wctx);
+    if (!*wctx)
+        return;
 
+    if ((*wctx)->writer->uninit)
+        (*wctx)->writer->uninit(*wctx);
     av_freep(&((*wctx)->priv));
     av_freep(wctx);
 }
@@ -924,6 +926,7 @@ static av_cold int xml_init(WriterContext *wctx, const char *args, void *opaque)
             av_log(wctx, AV_LOG_ERROR,                                  \
                    "XSD-compliant output selected but option '%s' was selected, XML output may be non-compliant.\n" \
                    "You need to disable such option with '-no%s'\n", opt_name, opt_name); \
+            return AVERROR(EINVAL);                                     \
         }
         CHECK_COMPLIANCE(show_private_data, "private");
         CHECK_COMPLIANCE(show_value_unit,   "unit");
@@ -1436,9 +1439,9 @@ end:
 
 static void show_usage(void)
 {
-    printf("Simple multimedia streams analyzer\n");
-    printf("usage: %s [OPTIONS] [INPUT_FILE]\n", program_name);
-    printf("\n");
+    av_log(NULL, AV_LOG_INFO, "Simple multimedia streams analyzer\n");
+    av_log(NULL, AV_LOG_INFO, "usage: %s [OPTIONS] [INPUT_FILE]\n", program_name);
+    av_log(NULL, AV_LOG_INFO, "\n");
 }
 
 static int opt_format(const char *opt, const char *arg)