From 720eb187fd33c6ccf7f6f75a94fb5a7b94c9ebf8 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 1 Feb 2015 18:25:12 +0100 Subject: command: send additional property change events in-between loading Opening the stream and opening the demuxer are both done asynchronously, meaning the player reacts to client API requests. They also can potentially take a while. Thus it's better to process outstanding property changes, so that change events are sent for properties that were changed during opening. --- player/command.c | 1 + player/command.h | 1 + player/loadfile.c | 1 + 3 files changed, 3 insertions(+) diff --git a/player/command.c b/player/command.c index b3adb5f731..09bd118f7f 100644 --- a/player/command.c +++ b/player/command.c @@ -3452,6 +3452,7 @@ static const char *const *const mp_event_property_change[] = { E(MPV_EVENT_START_FILE, "*"), E(MPV_EVENT_END_FILE, "*"), E(MPV_EVENT_FILE_LOADED, "*"), + E(MP_EVENT_CHANGE_ALL, "*"), E(MPV_EVENT_TRACKS_CHANGED, "track-list"), E(MPV_EVENT_TRACK_SWITCHED, "vid", "video", "aid", "audio", "sid", "sub", "secondary-sid"), diff --git a/player/command.h b/player/command.h index d6891b66cd..30387946d3 100644 --- a/player/command.h +++ b/player/command.h @@ -43,6 +43,7 @@ enum { // Must start with the first unused positive value in enum mpv_event_id // MPV_EVENT_* and MP_EVENT_* must not overlap. INTERNAL_EVENT_BASE = 25, + MP_EVENT_CHANGE_ALL, MP_EVENT_CACHE_UPDATE, MP_EVENT_WIN_RESIZE, MP_EVENT_WIN_STATE, diff --git a/player/loadfile.c b/player/loadfile.c index 92018135e7..549aacc8de 100644 --- a/player/loadfile.c +++ b/player/loadfile.c @@ -1019,6 +1019,7 @@ static void play_current_file(struct MPContext *mpctx) stream_enable_cache(&mpctx->stream, &opts->stream_cache); + mp_notify(mpctx, MP_EVENT_CHANGE_ALL, NULL); mp_process_input(mpctx); if (mpctx->stop_play) goto terminate_playback; -- cgit v1.2.3