0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 03:52:22 +02:00

client API: fix MPV_FORMAT_DOUBLE => MPV_FORMAT_INT64

(Why can it do this conversion at all? This is  shitshow anyway.)
This commit is contained in:
wm4 2020-03-18 20:43:56 +01:00
parent 5a81de59a8
commit f73db96077

View File

@ -985,7 +985,9 @@ 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_ > (double)INT64_MIN &&
src->u.double_ < (double)INT64_MAX)
{
*(int64_t *)dst = src->u.double_;
return true;
}