History

player: run all update handlers on init

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

Dudemanguy committed 1 year ago

Commit e2f21991 parent 1b9ac223 files · +3 −1Browse files

Unified · Split

3 files
  1. player/core.h +1 −0
  2. player/main.c +1 −0
  3. player/playloop.c +1 −1
player/core.h+1−0
@@ -600,6 +600,7 @@ void mp_wakeup_core(struct MPContext *mpctx); · 599 unmodified lines
600void mp_wakeup_core_cb(void *ctx);600void mp_wakeup_core_cb(void *ctx);
601void mp_core_lock(struct MPContext *mpctx);601void mp_core_lock(struct MPContext *mpctx);
602void mp_core_unlock(struct MPContext *mpctx);602void mp_core_unlock(struct MPContext *mpctx);
603void handle_option_callbacks(struct MPContext *mpctx);
603double get_relative_time(struct MPContext *mpctx);604double get_relative_time(struct MPContext *mpctx);
604void reset_playback_state(struct MPContext *mpctx);605void reset_playback_state(struct MPContext *mpctx);
605void set_pause_state(struct MPContext *mpctx, bool user_pause);606void set_pause_state(struct MPContext *mpctx, bool user_pause);
player/main.c+1−0
@@ -383,6 +383,7 @@ int mp_initialize(struct MPContext *mpctx, char **options) · 382 unmodified lines
383 m_config_set_update_dispatch_queue(mpctx->mconfig, mpctx->dispatch);383 m_config_set_update_dispatch_queue(mpctx->mconfig, mpctx->dispatch);
384 // Run all update handlers.384 // Run all update handlers.
385 mp_option_change_callback(mpctx, NULL, UPDATE_OPTS_MASK, false);385 mp_option_change_callback(mpctx, NULL, UPDATE_OPTS_MASK, false);
386 handle_option_callbacks(mpctx);
386 387
387 if (handle_help_options(mpctx))388 if (handle_help_options(mpctx))
388 return 1; // help389 return 1; // help
player/playloop.c+1−1
@@ -122,7 +122,7 @@ static void mp_process_input(struct MPContext *mpctx) · 121 unmodified lines
122}122}
123 123
124// Process any queued option callbacks.124// Process any queued option callbacks.
125static void handle_option_callbacks(struct MPContext *mpctx)125void handle_option_callbacks(struct MPContext *mpctx)
126{126{
127 for (int i = 0; i < mpctx->num_option_callbacks; i++)127 for (int i = 0; i < mpctx->num_option_callbacks; i++)
128 mp_option_run_callback(mpctx, i);128 mp_option_run_callback(mpctx, i);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t