Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
lektor
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Compilation
Pipelines
Jobs
Planifications de pipeline
Artéfacts
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
Kubat
lektor
Validations
28fb4c22
Vérifiée
Valider
28fb4c22
rédigé
4 years ago
par
Kubat
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
MOD: Add a way not to force the X11 gpu context for libmpv
parent
c0b29298
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion
!128
Resolve "Add a way to not force the x11 display"
Pipeline
#1960
réussi
4 years ago
Étape : initialization
Étape : configure
Étape : build
Étape : finalization
Modifications
2
Pipelines
1
Masquer les modifications d'espaces
En ligne
Côte à côte
Affichage de
2 fichiers modifiés
inc/lektor/config.def
+1
-0
1 ajout, 0 suppression
inc/lektor/config.def
src/module/mpv.c
+23
-12
23 ajouts, 12 suppressions
src/module/mpv.c
avec
24 ajouts
et
12 suppressions
inc/lektor/config.def
+
1
−
0
Voir le fichier @
28fb4c22
...
@@ -38,6 +38,7 @@ value("def_repeat", "false")
...
@@ -38,6 +38,7 @@ value("def_repeat", "false")
value
(
"font_size"
,
"20"
)
value
(
"font_size"
,
"20"
)
value
(
"font_name"
,
"Hack Nerd Font"
)
value
(
"font_name"
,
"Hack Nerd Font"
)
value
(
"msg_duration"
,
"4"
)
value
(
"msg_duration"
,
"4"
)
value_opt
(
"force_x11"
,
"1"
)
/* Force libmpv to use x11, may segfault on some PCs... */
/* To place hooks, when some things are done in lektor. The default value 'none' is here so that
/* To place hooks, when some things are done in lektor. The default value 'none' is here so that
nothing happens. Like any module, the value can point to a module or a function in the internal
nothing happens. Like any module, the value can point to a module or a function in the internal
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
src/module/mpv.c
+
23
−
12
Voir le fichier @
28fb4c22
...
@@ -29,27 +29,38 @@ lmpv_prepare(volatile sqlite3 *db)
...
@@ -29,27 +29,38 @@ lmpv_prepare(volatile sqlite3 *db)
RETURN_UNLESS
(
ctx
,
"Failed to create context"
,
NULL
);
RETURN_UNLESS
(
ctx
,
"Failed to create context"
,
NULL
);
char
_opt
[
LKT_LINE_MAX
];
char
_opt
[
LKT_LINE_MAX
];
#define MPV_SET_OPTION(opt, value) \
#define MPV_SET_OPTION(opt, value)
\
if ((status = mpv_set_option_string(ctx, opt, value)) < 0) { \
if ((status = mpv_set_option_string(ctx, opt, value)) < 0) {
\
LOG_ERROR("WINDOW", "Failed to set %s to %s: %s", \
LOG_ERROR("WINDOW", "Failed to set %s to %s: %s",
\
opt, value, mpv_error_string(status)); \
opt, value, mpv_error_string(status));
\
return NULL; \
return NULL;
\
}
}
#define MPV_SET_FROM_INI(opt, section, key) \
#define MPV_SET_FROM_INI(opt, section, key)
\
if (!database_config_get_text(db, section, key, _opt, LKT_LINE_MAX)) { \
if (!database_config_get_text(db, section, key, _opt, LKT_LINE_MAX)) {
\
LOG_WARN("WINDOW", "Failed to get option " \
LOG_WARN("WINDOW", "Failed to get option "
\
key " in section " section); \
key " in section " section);
\
return ctx; \
return ctx;
\
} \
}
\
MPV_SET_OPTION(opt, _opt);
MPV_SET_OPTION(opt, _opt);
#define MPV_SET_OPTION_COND(opt, value, ini_section, ini_option, def) ({ \
int ___cond; \
if (!database_config_get_int(db, ini_section, ini_option, &___cond)) { \
LOG_WARN("WINDOW", "Using default value '" #def "' because [" \
#ini_section "->" #ini_option "] was not present in ini " \
"config file"); \
___cond = (def); \
} \
if (___cond) \
MPV_SET_OPTION(opt, value); \
})
MPV_SET_OPTION
(
"input-default-bindings"
,
"yes"
);
MPV_SET_OPTION
(
"input-default-bindings"
,
"yes"
);
MPV_SET_OPTION
(
"input-vo-keyboard"
,
"yes"
);
MPV_SET_OPTION
(
"input-vo-keyboard"
,
"yes"
);
MPV_SET_OPTION
(
"replaygain"
,
"track"
);
MPV_SET_OPTION
(
"replaygain"
,
"track"
);
MPV_SET_OPTION
(
"gpu-context"
,
"x11"
);
/* Wayland you sucks */
MPV_SET_OPTION
(
"demuxer-readahead-secs"
,
"5.0"
);
MPV_SET_OPTION
(
"demuxer-readahead-secs"
,
"5.0"
);
MPV_SET_OPTION
(
"demuxer-max-bytes"
,
"100M"
);
MPV_SET_OPTION
(
"demuxer-max-bytes"
,
"100M"
);
MPV_SET_OPTION
(
"hwdec"
,
"yes"
);
MPV_SET_OPTION
(
"hwdec"
,
"yes"
);
MPV_SET_OPTION_COND
(
"gpu-context"
,
"x11"
,
"player"
,
"force_x11"
,
1
);
/* Wayland you sucks */
MPV_SET_FROM_INI
(
"osd-font-size"
,
"player"
,
"font_size"
);
MPV_SET_FROM_INI
(
"osd-font-size"
,
"player"
,
"font_size"
);
MPV_SET_FROM_INI
(
"osd-font"
,
"player"
,
"font_name"
);
MPV_SET_FROM_INI
(
"osd-font"
,
"player"
,
"font_name"
);
MPV_SET_FROM_INI
(
"osd-duration"
,
"player"
,
"msg_duration"
);
MPV_SET_FROM_INI
(
"osd-duration"
,
"player"
,
"msg_duration"
);
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter