client API: don't update properties in uninitialized state
If an API user calls mpv_wait_event() and mpv_observe_property() before mpv_initialize(), it could happen that a property was accessed before initialization, which is not ok.
This commit is contained in:
1 parent
4279712d1e
commit
ecbb12923f
1 file changed
+2
@@ -1188,6 +1188,8 @@ static void update_prop(void *p)
|
||||
// outstanding property.
|
||||
static bool gen_property_change_event(struct mpv_handle *ctx)
|
||||
{
|
||||
if (!ctx->mpctx->initialized)
|
||||
return false;
|
||||
int start = ctx->lowest_changed;
|
||||
ctx->lowest_changed = ctx->num_properties;
|
||||
for (int n = start; n < ctx->num_properties; n++) {
|
||||
|
||||
Reference in new issue
Block a user