mirror of
https://github.com/mpv-player/mpv
synced 2025-01-12 09:59:44 +00:00
input: fix cycle 2nd argument stringification
Triggered the fallback code that formatted the argument as "(NULL)".
This commit is contained in:
parent
90c11fa729
commit
da913998d3
@ -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),
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user