summaryrefslogtreecommitdiffstats
path: root/input/cmd.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2020-01-19 20:53:26 +0100
committerwm4 <wm4@nowhere>2020-01-19 20:53:26 +0100
commitda913998d365db554ba2dc3b10b33b78dddcea17 (patch)
treef3917c51af5d548adb6a6b1b1a11d0850e786f89 /input/cmd.c
parent90c11fa72986bbed58300056ac9b30f691499292 (diff)
downloadmpv-da913998d365db554ba2dc3b10b33b78dddcea17.tar.bz2
mpv-da913998d365db554ba2dc3b10b33b78dddcea17.tar.xz
input: fix cycle 2nd argument stringification
Triggered the fallback code that formatted the argument as "(NULL)".
Diffstat (limited to 'input/cmd.c')
-rw-r--r--input/cmd.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/input/cmd.c b/input/cmd.c
index e9449915f9..5a073d9fec 100644
--- a/input/cmd.c
+++ b/input/cmd.c
@@ -615,6 +615,11 @@ static int parse_cycle_dir(struct mp_log *log, const struct m_option *opt,
return 1;
}
+static char *print_cycle_dir(const m_option_t *opt, const void *val)
+{
+ return talloc_asprintf(NULL, "%f", *(double *)val);
+}
+
static void copy_opt(const m_option_t *opt, void *dst, const void *src)
{
if (dst && src)
@@ -624,6 +629,7 @@ static void copy_opt(const m_option_t *opt, void *dst, const void *src)
const struct m_option_type m_option_type_cycle_dir = {
.name = "up|down",
.parse = parse_cycle_dir,
+ .print = print_cycle_dir,
.copy = copy_opt,
.size = sizeof(double),
};