The refactoring in bbac628a1b01261766459c6556e36d2443a42534 missed that the initial update handler didn't immediately run all the triggered callbacks but would instead delay it until the next playloop. This subtly breaks things of course like hooks, force window handling, etc. Ensure that we immediately run all the callbacks like before on startup. Fixes bbac628a1b01261766459c6556e36d2443a42534 Fixes https://github.com/mpv-player/mpv/pull/15828#issuecomment-2663830477
Unified · Split
| @@ -600,6 +600,7 @@ void mp_wakeup_core(struct MPContext *mpctx); · 599 unmodified lines | ||
| 600 | 600 | void mp_wakeup_core_cb(void *ctx); |
| 601 | 601 | void mp_core_lock(struct MPContext *mpctx); |
| 602 | 602 | void mp_core_unlock(struct MPContext *mpctx); |
| 603 | +void handle_option_callbacks(struct MPContext *mpctx); | |
| 603 | 604 | double get_relative_time(struct MPContext *mpctx); |
| 604 | 605 | void reset_playback_state(struct MPContext *mpctx); |
| 605 | 606 | void set_pause_state(struct MPContext *mpctx, bool user_pause); |
| @@ -383,6 +383,7 @@ int mp_initialize(struct MPContext *mpctx, char **options) · 382 unmodified lines | ||
| 383 | 383 | m_config_set_update_dispatch_queue(mpctx->mconfig, mpctx->dispatch); |
| 384 | 384 | // Run all update handlers. |
| 385 | 385 | mp_option_change_callback(mpctx, NULL, UPDATE_OPTS_MASK, false); |
| 386 | + handle_option_callbacks(mpctx); | |
| 386 | 387 | |
| 387 | 388 | if (handle_help_options(mpctx)) |
| 388 | 389 | return 1; // help |
| @@ -122,7 +122,7 @@ static void mp_process_input(struct MPContext *mpctx) · 121 unmodified lines | ||
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | // Process any queued option callbacks. |
| 125 | −static void handle_option_callbacks(struct MPContext *mpctx) | |
| 125 | +void handle_option_callbacks(struct MPContext *mpctx) | |
| 126 | 126 | { |
| 127 | 127 | for (int i = 0; i < mpctx->num_option_callbacks; i++) |
| 128 | 128 | mp_option_run_callback(mpctx, i); |