summaryrefslogtreecommitdiffstats
path: root/libvo/vo_md5sum.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_md5sum.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_md5sum.c')
-rw-r--r--libvo/vo_md5sum.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/libvo/vo_md5sum.c b/libvo/vo_md5sum.c
index d4a08414ee..35ce3a645e 100644
--- a/libvo/vo_md5sum.c
+++ b/libvo/vo_md5sum.c
@@ -103,9 +103,8 @@ void md5sum_write_error(void) {
static uint32_t preinit(const char *arg)
{
- strarg_t outfile = {0, NULL};
opt_t subopts[] = {
- {"outfile", OPT_ARG_STR, &outfile, NULL},
+ {"outfile", OPT_ARG_MSTRZ, &md5sum_outfile, NULL},
{NULL}
};
@@ -114,18 +113,11 @@ static uint32_t preinit(const char *arg)
mp_msg(MSGT_VO, MSGL_INFO, "%s: %s\n", info.short_name,
MSGTR_VO_ParsingSuboptions);
+ md5sum_outfile = strdup("md5sums");
if (subopt_parse(arg, subopts) != 0) {
return -1;
}
- if (outfile.len) {
- md5sum_outfile = malloc(outfile.len + 1);
- memcpy(md5sum_outfile, outfile.str, outfile.len);
- md5sum_outfile[outfile.len] = '\0';
- } else {
- md5sum_outfile = strdup("md5sums");
- }
-
mp_msg(MSGT_VO, MSGL_V, "%s: outfile --> %s\n", info.short_name,
md5sum_outfile);