summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-08-30 23:50:57 +0200
committerwm4 <wm4@nowhere>2016-08-30 23:50:57 +0200
commitaf1379c43d6a5274b75bce0adeef9e3a9ce87bdf (patch)
treeba90dc6c885374095a1051c8dde7f983eca7b7e9 /player
parente65a8d7b61762ddf07825c59a6ebd47b026b0ea7 (diff)
downloadmpv-af1379c43d6a5274b75bce0adeef9e3a9ce87bdf.tar.bz2
mpv-af1379c43d6a5274b75bce0adeef9e3a9ce87bdf.tar.xz
options: make mp_vo_opts options an actual sub-option group
Just a minor refactor along the planned option change. This commit will make it easier to update (i.e. copy) the VO options without copying _all_ options. For now, behavior should be equivalent, though. (The VO options were put into a separate struct quite early - when all global variables were removed from the source code. It wasn't clear whether the separate struct would have any actual purpose, but it seems it will now. Awesome, huh.)
Diffstat (limited to 'player')
-rw-r--r--player/command.c16
-rw-r--r--player/configfiles.c4
-rw-r--r--player/misc.c2
-rw-r--r--player/playloop.c2
4 files changed, 12 insertions, 12 deletions
diff --git a/player/command.c b/player/command.c
index 1c59d130ce..a59fa059b8 100644
--- a/player/command.c
+++ b/player/command.c
@@ -2371,10 +2371,10 @@ static int mp_property_fullscreen(void *ctx, struct m_property *prop,
int action, void *arg)
{
MPContext *mpctx = ctx;
- int oldval = mpctx->opts->vo.fullscreen;
+ int oldval = mpctx->opts->vo->fullscreen;
int r = mp_property_vo_flag(prop, action, arg, VOCTRL_FULLSCREEN,
- &mpctx->opts->vo.fullscreen, mpctx);
- if (oldval && oldval != mpctx->opts->vo.fullscreen)
+ &mpctx->opts->vo->fullscreen, mpctx);
+ if (oldval && oldval != mpctx->opts->vo->fullscreen)
mpctx->mouse_event_ts--; // Show mouse cursor
return r;
}
@@ -2386,9 +2386,9 @@ static int mp_property_taskbar_progress(void *ctx, struct m_property *prop,
MPContext *mpctx = ctx;
if (action == M_PROPERTY_SET) {
int desired = !!*(int *) arg;
- if (mpctx->opts->vo.taskbar_progress == desired)
+ if (mpctx->opts->vo->taskbar_progress == desired)
return M_PROPERTY_OK;
- mpctx->opts->vo.taskbar_progress = desired;
+ mpctx->opts->vo->taskbar_progress = desired;
if (mpctx->video_out)
update_vo_playback_state(mpctx);
return M_PROPERTY_OK;
@@ -2402,7 +2402,7 @@ static int mp_property_ontop(void *ctx, struct m_property *prop,
{
MPContext *mpctx = ctx;
return mp_property_vo_flag(prop, action, arg, VOCTRL_ONTOP,
- &mpctx->opts->vo.ontop, mpctx);
+ &mpctx->opts->vo->ontop, mpctx);
}
/// Show window borders (RW)
@@ -2411,7 +2411,7 @@ static int mp_property_border(void *ctx, struct m_property *prop,
{
MPContext *mpctx = ctx;
return mp_property_vo_flag(prop, action, arg, VOCTRL_BORDER,
- &mpctx->opts->vo.border, mpctx);
+ &mpctx->opts->vo->border, mpctx);
}
static int mp_property_all_workspaces(void *ctx, struct m_property *prop,
@@ -2419,7 +2419,7 @@ static int mp_property_all_workspaces(void *ctx, struct m_property *prop,
{
MPContext *mpctx = ctx;
return mp_property_vo_flag(prop, action, arg, VOCTRL_ALL_WORKSPACES,
- &mpctx->opts->vo.all_workspaces, mpctx);
+ &mpctx->opts->vo->all_workspaces, mpctx);
}
static int get_frame_count(struct MPContext *mpctx)
diff --git a/player/configfiles.c b/player/configfiles.c
index 7356a9a81b..59cb510bf8 100644
--- a/player/configfiles.c
+++ b/player/configfiles.c
@@ -152,8 +152,8 @@ void mp_load_auto_profiles(struct MPContext *mpctx)
mp_load_per_file_config(mpctx);
- if (opts->vo.video_driver_list)
- mp_auto_load_profile(mpctx, "vo", bstr0(opts->vo.video_driver_list[0].name));
+ if (opts->vo->video_driver_list)
+ mp_auto_load_profile(mpctx, "vo", bstr0(opts->vo->video_driver_list[0].name));
if (opts->audio_driver_list)
mp_auto_load_profile(mpctx, "ao", bstr0(opts->audio_driver_list[0].name));
}
diff --git a/player/misc.c b/player/misc.c
index c9e25a3966..79fad39687 100644
--- a/player/misc.c
+++ b/player/misc.c
@@ -134,7 +134,7 @@ void update_vo_playback_state(struct MPContext *mpctx)
if (mpctx->video_out) {
struct voctrl_playback_state oldstate = mpctx->vo_playback_state;
struct voctrl_playback_state newstate = {
- .taskbar_progress = mpctx->opts->vo.taskbar_progress,
+ .taskbar_progress = mpctx->opts->vo->taskbar_progress,
.playing = mpctx->playing,
.paused = mpctx->paused,
.percent_pos = get_percent_pos(mpctx),
diff --git a/player/playloop.c b/player/playloop.c
index 3bf2216962..079d3a952a 100644
--- a/player/playloop.c
+++ b/player/playloop.c
@@ -662,7 +662,7 @@ static void handle_cursor_autohide(struct MPContext *mpctx)
if (opts->cursor_autohide_delay == -2)
mouse_cursor_visible = false;
- if (opts->cursor_autohide_fs && !opts->vo.fullscreen)
+ if (opts->cursor_autohide_fs && !opts->vo->fullscreen)
mouse_cursor_visible = true;
if (mouse_cursor_visible != mpctx->mouse_cursor_visible)