summaryrefslogtreecommitdiffstats
path: root/player/main.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-09-02 15:59:40 +0200
committerwm4 <wm4@nowhere>2016-09-02 21:21:47 +0200
commit849480d0c9d5ef76bd3296034b2ad5019fb9c21d (patch)
treeef72fcfbbcce7fb0c88048ae70a0ec42cdf7866a /player/main.c
parenta07dae57e31882024518008c5c1c45f932c15193 (diff)
downloadmpv-849480d0c9d5ef76bd3296034b2ad5019fb9c21d.tar.bz2
mpv-849480d0c9d5ef76bd3296034b2ad5019fb9c21d.tar.xz
vo_opengl: deprecate sub-options, add them as global options
vo_opengl sub-option were always rather annoying to handle. It seems better to make them global options instead. This is simpler and easier to use. The only disadvantage we are aware of is that it's not clear that many/all of these new global options work with vo_opengl only. --vo=opengl-hq is also deprecated. There is extensive compatibility with the old behavior. One exception is that --vo-defaults will not apply to opengl-hq (though with opengl it still works). vo-cmdline is also dysfunctional and will be removed in a following commit. These changes also affect opengl-cb. The update mechanism is still rather inefficient: it requires syncing with the VO after each option change, rather than batching updates. There's also no granularity (video.c just updates "everything", and if auto-ICC profiles are enabled, vo_opengl.c will fetch them on each update). Most of the manpage changes were done by Niklas Haas <git@haasn.xyz>.
Diffstat (limited to 'player/main.c')
-rw-r--r--player/main.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/player/main.c b/player/main.c
index b60c522cb0..5f20ae9891 100644
--- a/player/main.c
+++ b/player/main.c
@@ -134,6 +134,16 @@ static const char def_config[] =
"osc=no\n"
"framedrop=no\n"
#endif
+ "\n"
+ "[opengl-hq]\n"
+ "scale=spline36\n"
+ "cscale=spline36\n"
+ "dscale=mitchell\n"
+ "dither-depth=auto\n"
+ "correct-downscaling=yes\n"
+ "sigmoid-upscaling=yes\n"
+ "deband=yes\n"
+ "opengl-es=no\n"
;
static pthread_mutex_t terminal_owner_lock = PTHREAD_MUTEX_INITIALIZER;
@@ -314,6 +324,21 @@ static bool handle_help_options(struct MPContext *mpctx)
return opt_exit;
}
+static void handle_deprecated_options(struct MPContext *mpctx)
+{
+ struct MPOpts *opts = mpctx->opts;
+ struct m_obj_settings *vo = opts->vo->video_driver_list;
+ if (vo && vo->name && strcmp(vo->name, "opengl-hq") == 0) {
+ MP_WARN(mpctx,
+ "--vo=opengl-hq is deprecated! Use --profile=opengl-hq instead.\n");
+ // Fudge it. This will replace the --vo option too, which is why we
+ // unset/safe it, and later restore it.
+ talloc_free(vo->name);
+ vo->name = talloc_strdup(NULL, "opengl");
+ m_config_set_profile(mpctx->mconfig, "opengl-hq", 0);
+ }
+}
+
static int cfg_include(void *ctx, char *filename, int flags)
{
struct MPContext *mpctx = ctx;
@@ -425,6 +450,8 @@ int mp_initialize(struct MPContext *mpctx, char **options)
if (handle_help_options(mpctx))
return -2;
+ handle_deprecated_options(mpctx);
+
if (!print_libav_versions(mp_null_log, 0)) {
// Using mismatched libraries can be legitimate, but even then it's
// a bad idea. We don't acknowledge its usefulness and stability.