[MPlayer-cvslog] r33646 - in trunk: DOCS/man/de/mplayer.1 DOCS/man/en/mplayer.1 libvo/vo_mng.c

cboesch subversion at mplayerhq.hu
Sat Jun 18 22:50:55 CEST 2011


Author: cboesch
Date: Sat Jun 18 22:50:55 2011
New Revision: 33646

Log:
vo_mng: add output sub-option.

This also makes it consistent with vo_gif.

Modified:
   trunk/libvo/vo_mng.c

Changes in other areas also in this revision:
Modified:
   trunk/DOCS/man/de/mplayer.1
   trunk/DOCS/man/en/mplayer.1

Modified: trunk/libvo/vo_mng.c
==============================================================================
--- trunk/libvo/vo_mng.c	Sat Jun 18 18:35:37 2011	(r33645)
+++ trunk/libvo/vo_mng.c	Sat Jun 18 22:50:55 2011	(r33646)
@@ -40,6 +40,7 @@
 #include "video_out.h"
 #include "video_out_internal.h"
 #include "mp_msg.h"
+#include "subopt-helper.h"
 
 #define VOMNG_DEFAULT_DELAY_MS (100) /* default delay of a frame */
 
@@ -566,6 +567,12 @@ static int draw_slice(uint8_t *srcimg[],
     return 0;
 }
 
+/** list of suboptions */
+static const opt_t subopts[] = {
+    {"output", OPT_ARG_MSTRZ, &vomng.out_file_name, NULL},
+    {NULL,     0,             NULL,                 NULL}
+};
+
 /**
  * @brief pre-initialize MNG vo module
  * @param[in] *arg arguments passed to MNG vo module (output file name)
@@ -573,19 +580,19 @@ static int draw_slice(uint8_t *srcimg[],
  */
 static int preinit(const char *arg)
 {
-    /* get name of output file */
-    if (!arg || !*arg) {
-        mp_msg(MSGT_VO, MSGL_ERR, "vomng: MNG output file must be given,"
-                                  " example: -vo mng:output.mng\n");
-        vomng_prop_cleanup();
-        return 1;
-    }
-    vomng.out_file_name = strdup(arg);
-    if (!vomng.out_file_name) {
-        mp_msg(MSGT_VO, MSGL_ERR, "vomng: out of memory\n");
+    if (subopt_parse(arg, subopts)) {
+        mp_msg(MSGT_VO, MSGL_ERR,
+               "\n-vo mng command line help:\n"
+               "Example: mplayer -vo mng:output=file.mng\n"
+               "\nOptions:\n"
+               "  output=<filename>\n"
+               "    Specify the output file.  The default is out.mng.\n"
+               "\n");
         vomng_prop_cleanup();
         return 1;
     }
+    if (!vomng.out_file_name)
+        vomng.out_file_name = strdup("out.mng");
 
     return 0;
 }


More information about the MPlayer-cvslog mailing list