client API: copy instead of move old value on async path

In theory, it's better to keep the old value, because that's more
consistent with the logic of using change timestamps. With the current
code, the old value will probably never be used (instead it will fetch a
new value on every change), so this shouldn't make a difference in
practice.
This commit is contained in:
wm4 2019-10-25 15:14:05 +02:00
parent e67386e50b
commit 5e2779b2da
1 changed files with 1 additions and 4 deletions

View File

@ -1593,11 +1593,8 @@ static bool update_prop(struct mpv_handle *ctx, struct observe_property *prop)
return false; // re-update later when the changed value comes in
}
// Move to val
memcpy(&val, &prop->async_value, prop->type->type->size);
m_option_copy(prop->type, &val, &prop->async_value);
val_valid = prop->async_value_valid;
prop->async_value = (union m_option_value){0};
prop->async_value_valid = false;
} else {
pthread_mutex_unlock(&ctx->lock);