client API: handle double->int64 conversion correctly

It signalled failure instead.
This commit is contained in:
wm4 2016-02-13 13:07:53 +01:00
parent 90089b860c
commit 0970763f69
1 changed files with 3 additions and 1 deletions

View File

@ -833,8 +833,10 @@ static bool conv_node_to_format(void *dst, mpv_format dst_fmt, mpv_node *src)
return true;
}
if (dst_fmt == MPV_FORMAT_INT64 && src->format == MPV_FORMAT_DOUBLE) {
if (src->u.double_ >= INT64_MIN && src->u.double_ <= INT64_MAX)
if (src->u.double_ >= INT64_MIN && src->u.double_ <= INT64_MAX) {
*(int64_t *)dst = src->u.double_;
return true;
}
}
return false;
}