summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-09-15 14:22:48 +0200
committerwm4 <wm4@nowhere>2016-09-15 14:50:38 +0200
commit9c9cf125ad71aeff7fe6979b7b5d1f44f2d1a6ac (patch)
treeb9e03cb03c32950fd4d2436f755ffea1c368b4ce /player
parent5968a307d5c05d1b4604be4fddd416b0aecb534e (diff)
downloadmpv-9c9cf125ad71aeff7fe6979b7b5d1f44f2d1a6ac.tar.bz2
mpv-9c9cf125ad71aeff7fe6979b7b5d1f44f2d1a6ac.tar.xz
osd: slightly simplify update logic
Remove the per-part force_redraw flags, and instead make the difference between flagging dirty state and returning it to the player frontend more explicit. The big issue is that 1. the OSD needs to know the dirty state, and it should be cleared strictly when it is re-rendered (force_redraw flag), and 2. the player core needs to be notified once, and the notification must be reset (want_redraw flag). The call in loadfile.c is replaced by making osd_set_sub() set the change flag. Increasing the change flag on dirty state (the force_redraw check in render_object()) should not be needed, because OSD part renderers set it correctly (at least now). Doing this just because someone pointed this out.
Diffstat (limited to 'player')
-rw-r--r--player/command.c4
-rw-r--r--player/loadfile.c1
2 files changed, 2 insertions, 3 deletions
diff --git a/player/command.c b/player/command.c
index 5d543e5552..1b7f9eb088 100644
--- a/player/command.c
+++ b/player/command.c
@@ -2911,7 +2911,7 @@ static int property_osd_helper(void *ctx, struct m_property *prop,
{
MPContext *mpctx = ctx;
if (action == M_PROPERTY_SET)
- osd_changed_all(mpctx->osd);
+ osd_changed(mpctx->osd);
return mp_property_generic_option(mpctx, prop, action, arg);
}
@@ -4909,7 +4909,7 @@ int run_command(struct MPContext *mpctx, struct mp_cmd *cmd, struct mpv_node *re
if (sub_control(sub, SD_CTRL_SUB_STEP, a) > 0) {
if (cmd->id == MP_CMD_SUB_STEP) {
opts->sub_delay -= a[0];
- osd_changed_all(mpctx->osd);
+ osd_changed(mpctx->osd);
show_property_osd(mpctx, "sub-delay", on_osd);
} else {
// We can easily get stuck by failing to seek to the video
diff --git a/player/loadfile.c b/player/loadfile.c
index 8f065e8d07..ebead19e4e 100644
--- a/player/loadfile.c
+++ b/player/loadfile.c
@@ -473,7 +473,6 @@ void mp_switch_track_n(struct MPContext *mpctx, int order, enum stream_type type
}
mp_notify(mpctx, MPV_EVENT_TRACK_SWITCHED, NULL);
- osd_changed_all(mpctx->osd);
talloc_free(mpctx->track_layout_hash);
mpctx->track_layout_hash = talloc_steal(mpctx, track_layout_hash(mpctx));