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
dbf12798
Vérifiée
Valider
dbf12798
rédigé
5 years ago
par
Kubat
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
Solve segfault and always check mpv events
parent
b6189d59
Aucune branche associée trouvée
Branches contenant la validation
Aucune étiquette associée trouvée
Étiquettes contenant la validation
1 requête de fusion
!57
Resolve "SDL2 module"
Modifications
2
Masquer les modifications d'espaces
En ligne
Côte à côte
Affichage de
2 fichiers modifiés
src/module/module_sdl2.c
+6
-14
6 ajouts, 14 suppressions
src/module/module_sdl2.c
src/module/mpv.c
+1
-1
1 ajout, 1 suppression
src/module/mpv.c
avec
7 ajouts
et
15 suppressions
src/module/module_sdl2.c
+
6
−
14
Voir le fichier @
dbf12798
...
@@ -36,7 +36,6 @@ struct module_sdl2_window {
...
@@ -36,7 +36,6 @@ struct module_sdl2_window {
pthread_mutex_t
mtx
;
pthread_mutex_t
mtx
;
struct
lkt_thread
self
;
struct
lkt_thread
self
;
volatile
int
launched
;
volatile
int
launched
;
volatile
int
mpv_wakeup
;
};
};
/* Thread related functions */
/* Thread related functions */
...
@@ -48,19 +47,19 @@ sdl_thread__(struct lkt_thread_arg *arg)
...
@@ -48,19 +47,19 @@ sdl_thread__(struct lkt_thread_arg *arg)
struct
lkt_thread
*
self
=
arg
->
self
;
struct
lkt_thread
*
self
=
arg
->
self
;
struct
module_sdl2_window
*
sdl2
=
win
->
window
;
struct
module_sdl2_window
*
sdl2
=
win
->
window
;
SDL_Event
event
;
SDL_Event
event
;
uint64_t
flags
,
redraw
=
0
;
uint64_t
flags
;
int
w
,
h
;
int
w
,
h
,
redraw
=
0
;
free
(
arg
);
free
(
arg
);
(
void
)
self
;
(
void
)
self
;
RETURN_UNLESS
(
sdl2
&&
sdl2
->
window
,
"Big nope here, the sdl window pointer is NULL"
,
NULL
);
RETURN_UNLESS
(
sdl2
&&
sdl2
->
window
,
"Big nope here, the sdl window pointer is NULL"
,
NULL
);
fprintf
(
stderr
,
" * Started SDL thread
\n
"
);
fprintf
(
stderr
,
" * Started SDL thread
\n
"
);
loop:
loop:
SDL_PollEvent
(
&
event
);
if
(
SDL_PollEvent
(
&
event
))
sched_yield
();
switch
(
event
.
type
)
{
switch
(
event
.
type
)
{
case
SDL_QUIT
:
case
SDL_QUIT
:
sched_yield
();
break
;
break
;
case
SDL_WINDOWEVENT
:
case
SDL_WINDOWEVENT
:
...
@@ -92,9 +91,6 @@ loop:
...
@@ -92,9 +91,6 @@ loop:
if
(
flags
&
MPV_RENDER_UPDATE_FRAME
)
if
(
flags
&
MPV_RENDER_UPDATE_FRAME
)
redraw
=
1
;
redraw
=
1
;
}
}
/* Handle mpv events are not done here. */
if
(
event
.
type
==
wakeup_on_mpv_events
)
sdl2
->
mpv_wakeup
=
1
;
}
}
if
(
redraw
)
{
if
(
redraw
)
{
...
@@ -336,10 +332,6 @@ module_sdl2_handle_events(struct lkt_win *const win, sqlite3 *db, enum mpd_idle_
...
@@ -336,10 +332,6 @@ module_sdl2_handle_events(struct lkt_win *const win, sqlite3 *db, enum mpd_idle_
{
{
struct
module_sdl2_window
*
sdl2
=
win
->
window
;
struct
module_sdl2_window
*
sdl2
=
win
->
window
;
RETURN_UNLESS
(
sdl2
,
"Can't handle events from a NULL window"
,
false
);
RETURN_UNLESS
(
sdl2
,
"Can't handle events from a NULL window"
,
false
);
if
(
sdl2
->
mpv_wakeup
)
{
return
!
lmpv_handle
(
win
,
(
mpv_handle
*
)
sdl2
->
mpv
,
db
,
mpd_idle_events
,
sdl2
->
mpv_wakeup
=
0
;
(
int
*
)
&
sdl2
->
mpv_time_pos
,
(
int
*
)
&
sdl2
->
mpv_duration
);
return
!
lmpv_handle
(
win
,
(
mpv_handle
*
)
sdl2
->
mpv
,
db
,
mpd_idle_events
,
(
int
*
)
&
sdl2
->
mpv_time_pos
,
(
int
*
)
&
sdl2
->
mpv_duration
);
}
else
return
true
;
}
}
Ce diff est replié.
Cliquez pour l'agrandir.
src/module/mpv.c
+
1
−
1
Voir le fichier @
dbf12798
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
void
void
lmpv_free
(
mpv_handle
**
ctx
)
lmpv_free
(
mpv_handle
**
ctx
)
{
{
RETURN_UNLESS
(
ctx
,
"Missing mpv ctx"
,
NOTHING
);
RETURN_UNLESS
(
ctx
&&
*
ctx
,
"Missing mpv ctx"
,
NOTHING
);
static
const
char
*
cmd
[]
=
{
"quit"
,
NULL
};
static
const
char
*
cmd
[]
=
{
"quit"
,
NULL
};
mpv_command
(
*
ctx
,
cmd
);
mpv_command
(
*
ctx
,
cmd
);
mpv_destroy
(
*
ctx
);
mpv_destroy
(
*
ctx
);
...
...
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