Skip to content

Commit 2b0c620

Browse files
author
wm4
committed
player: move builtin profiles to a separate file
Move the embedded string with the builtin profiles to a separate builtin.conf file. This makes it easier to read and edit, and you can also check it for errors with --include=etc/builtin.conf. (Normally errors are hidden intentionally, because there's no way to output error messages this early, and because some options might not be present on all platforms or with all configurations.)
1 parent 98f1b5f commit 2b0c620

File tree

5 files changed

+51
-50
lines changed

5 files changed

+51
-50
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
/demux/ebml_types.h
2020
/sub/osd_font.h
2121
/player/lua/*.inc
22+
/player/builtin_conf.inc
2223
/DOCS/man/mpv.1
2324
/DOCS/man/mpv.aux
2425
/DOCS/man/mpv.log

etc/builtin.conf

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
[pseudo-gui]
2+
terminal=no
3+
force-window=yes
4+
idle=once
5+
screenshot-directory=~~desktop/
6+
7+
[libmpv]
8+
config=no
9+
idle=yes
10+
terminal=no
11+
input-terminal=no
12+
osc=no
13+
ytdl=no
14+
input-default-bindings=no
15+
input-vo-keyboard=no
16+
input-lirc=no
17+
input-appleremote=no
18+
input-media-keys=no
19+
input-app-events=no
20+
stop-playback-on-init-failure=yes
21+
22+
[encoding]
23+
vo=lavc
24+
ao=lavc
25+
keep-open=no
26+
force-window=no
27+
gapless-audio=yes
28+
resume-playback=no
29+
load-scripts=no
30+
osc=no
31+
framedrop=no
32+
33+
[opengl-hq]
34+
scale=spline36
35+
cscale=spline36
36+
dscale=mitchell
37+
dither-depth=auto
38+
correct-downscaling=yes
39+
sigmoid-upscaling=yes
40+
deband=yes

options/options.c

+2
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ const struct m_sub_options vo_sub_opts = {
210210
.window_scale = 1.0,
211211
.x11_bypass_compositor = 2,
212212
.mmcss_profile = "Playback",
213+
.fullscreen = HAVE_RPI ? 1 : 0,
213214
},
214215
};
215216

@@ -865,6 +866,7 @@ const struct MPOpts mp_default_opts = {
865866
.sub_fix_timing = 1,
866867
.screenshot_template = "mpv-shot%n",
867868

869+
.hwdec_api = HAVE_RPI ? HWDEC_RPI : 0,
868870
.hwdec_codecs = "h264,vc1,wmv3,hevc,mpeg2video,vp9",
869871
.videotoolbox_format = IMGFMT_NV12,
870872

player/main.c

+4-50
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@
6262
#include "command.h"
6363
#include "screenshot.h"
6464

65+
static const char def_config[] =
66+
#include "player/builtin_conf.inc"
67+
;
68+
6569
#ifdef _WIN32
6670
#include <windows.h>
6771
#endif
@@ -99,56 +103,6 @@ const char mp_help_text[] =
99103
" --h=<pat> print options which match the given shell pattern\n"
100104
"\n";
101105

102-
static const char def_config[] =
103-
#if HAVE_RPI
104-
"hwdec=rpi\n"
105-
"fullscreen=yes\n"
106-
#endif
107-
"\n"
108-
"[pseudo-gui]\n"
109-
"terminal=no\n"
110-
"force-window=yes\n"
111-
"idle=once\n"
112-
"screenshot-directory=~~desktop/\n"
113-
"\n"
114-
"[libmpv]\n"
115-
"config=no\n"
116-
"idle=yes\n"
117-
"terminal=no\n"
118-
"input-terminal=no\n"
119-
"osc=no\n"
120-
"ytdl=no\n"
121-
"input-default-bindings=no\n"
122-
"input-vo-keyboard=no\n"
123-
"input-lirc=no\n"
124-
"input-appleremote=no\n"
125-
"input-media-keys=no\n"
126-
"input-app-events=no\n"
127-
"stop-playback-on-init-failure=yes\n"
128-
#if HAVE_ENCODING
129-
"\n"
130-
"[encoding]\n"
131-
"vo=lavc\n"
132-
"ao=lavc\n"
133-
"keep-open=no\n"
134-
"force-window=no\n"
135-
"gapless-audio=yes\n"
136-
"resume-playback=no\n"
137-
"load-scripts=no\n"
138-
"osc=no\n"
139-
"framedrop=no\n"
140-
#endif
141-
"\n"
142-
"[opengl-hq]\n"
143-
"scale=spline36\n"
144-
"cscale=spline36\n"
145-
"dscale=mitchell\n"
146-
"dither-depth=auto\n"
147-
"correct-downscaling=yes\n"
148-
"sigmoid-upscaling=yes\n"
149-
"deband=yes\n"
150-
;
151-
152106
static pthread_mutex_t terminal_owner_lock = PTHREAD_MUTEX_INITIALIZER;
153107
static struct MPContext *terminal_owner;
154108

wscript_build.py

+4
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ def build(ctx):
6363
source = "etc/input.conf",
6464
target = "input/input_conf.h")
6565

66+
ctx.file2string(
67+
source = "etc/builtin.conf",
68+
target = "player/builtin_conf.inc")
69+
6670
ctx.file2string(
6771
source = "sub/osd_font.otf",
6872
target = "sub/osd_font.h")

0 commit comments

Comments
 (0)