[FFmpeg-devel] [PATCH] -h message to stdout

Nicolas George nicolas.george
Tue May 8 11:32:56 CEST 2007


L'octidi 18 flor?al, an CCXV, Michael Niedermayer a ?crit?:
> <snip>

Thanks for your remarks.

Here is the patch.

I would also like to fix the double-banner in "ffmpeg -h", and adjust the
return value, but that will go in another patch.

Regards,

-- 
  Nicolas George


Index: ffmpeg.c
===================================================================
--- ffmpeg.c	(revision 8929)
+++ ffmpeg.c	(working copy)
@@ -3718,6 +3718,13 @@
     exit(1);
 }
 
+/* this callback is only suitable to be used in show_help and similar
+ * functions because it lacks prefix handling */
+static void log_callback_help(void* ptr, int level, const char* fmt, va_list vl)
+{
+    vfprintf(stdout, fmt, vl);
+}
+
 static void show_help(void)
 {
     show_banner();
@@ -3747,6 +3754,7 @@
     show_help_options(options, "\nAdvanced options:\n",
                       OPT_EXPERT | OPT_AUDIO | OPT_VIDEO | OPT_GRAB,
                       OPT_EXPERT);
+    av_log_set_callback(log_callback_help);
     av_opt_show(avctx_opts[0], NULL);
     av_opt_show(avformat_opts, NULL);
 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 185 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070508/5ffb6715/attachment.pgp>



More information about the ffmpeg-devel mailing list