summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2019-10-25 15:14:05 +0200
committerwm4 <wm4@nowhere>2019-10-25 15:14:05 +0200
commit5e2779b2da089dda8f7e0e1814a37cdd2dffa357 (patch)
tree2b833a8cf3e56d0e171010fcb9bf837d84c7ce35
parente67386e50be262820a632effbb2b17ecaf98c737 (diff)
downloadmpv-5e2779b2da089dda8f7e0e1814a37cdd2dffa357.tar.bz2
mpv-5e2779b2da089dda8f7e0e1814a37cdd2dffa357.tar.xz
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.
-rw-r--r--player/client.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/player/client.c b/player/client.c
index 6d95faae48..3462845aed 100644
--- a/player/client.c
+++ b/player/client.c
@@ -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);