mirror of
https://github.com/mpv-player/mpv
synced 2024-12-26 09:02:38 +00:00
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:
parent
e67386e50b
commit
5e2779b2da
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user