summaryrefslogtreecommitdiffstats
path: root/libvo/vo_jpeg.c
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-01-19 17:10:20 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-01-19 17:10:20 +0000
commitca8fc9929bdc71e2192a8fdbcab2eb0c1fb6191c (patch)
treeeb22dec8700b3581b735ae10863416673aac0c70 /libvo/vo_jpeg.c
parentce701ae4386237798ffe06447021481e8e8002fc (diff)
downloadmpv-ca8fc9929bdc71e2192a8fdbcab2eb0c1fb6191c.tar.bz2
mpv-ca8fc9929bdc71e2192a8fdbcab2eb0c1fb6191c.tar.xz
New suboption type: malloc'ed, zero terminated string
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14539 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/vo_jpeg.c')
-rw-r--r--libvo/vo_jpeg.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/libvo/vo_jpeg.c b/libvo/vo_jpeg.c
index 6d1c097d1e..9fe73f425f 100644
--- a/libvo/vo_jpeg.c
+++ b/libvo/vo_jpeg.c
@@ -325,7 +325,6 @@ static int int_pos(int *mf)
static uint32_t preinit(const char *arg)
{
- strarg_t outdir = {0, NULL}, subdirs = {0, NULL};
opt_t subopts[] = {
{"progressive", OPT_ARG_BOOL, &jpeg_progressive_mode, NULL},
{"baseline", OPT_ARG_BOOL, &jpeg_baseline, NULL},
@@ -335,8 +334,8 @@ static uint32_t preinit(const char *arg)
(opt_test_f)int_zero_hundred},
{"quality", OPT_ARG_INT, &jpeg_quality,
(opt_test_f)int_zero_hundred},
- {"outdir", OPT_ARG_STR, &outdir, NULL},
- {"subdirs", OPT_ARG_STR, &subdirs, NULL},
+ {"outdir", OPT_ARG_MSTRZ, &jpeg_outdir, NULL},
+ {"subdirs", OPT_ARG_MSTRZ, &jpeg_subdirs, NULL},
{"maxfiles", OPT_ARG_INT, &jpeg_maxfiles, (opt_test_f)int_pos},
{NULL}
};
@@ -351,25 +350,13 @@ static uint32_t preinit(const char *arg)
jpeg_smooth = 0;
jpeg_quality = 75;
jpeg_maxfiles = 1000;
+ jpeg_outdir = strdup(".");
+ jpeg_subdirs = NULL;
if (subopt_parse(arg, subopts) != 0) {
return -1;
}
- if (outdir.len) {
- jpeg_outdir = malloc(outdir.len + 1);
- memcpy(jpeg_outdir, outdir.str, outdir.len);
- jpeg_outdir[outdir.len] = '\0';
- } else {
- jpeg_outdir = strdup(".");
- }
-
- if (subdirs.len) {
- jpeg_subdirs = malloc(subdirs.len + 1);
- memcpy(jpeg_subdirs, subdirs.str, subdirs.len);
- jpeg_subdirs[subdirs.len] = '\0';
- }
-
if (jpeg_progressive_mode) info_message = MSGTR_VO_JPEG_ProgressiveJPEG;
else info_message = MSGTR_VO_JPEG_NoProgressiveJPEG;
mp_msg(MSGT_VO, MSGL_INFO, "%s: %s\n", info.short_name, info_message);