[vlc-commits] hotkeys: fix race on sys.vrnav.b_can_change
Rémi Denis-Courmont
git at videolan.org
Wed Jun 6 19:00:54 CEST 2018
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Jun 6 19:55:49 2018 +0300| [c95ca64e317f9f49659476b7943b41cb623cfd6a] | committer: Rémi Denis-Courmont
hotkeys: fix race on sys.vrnav.b_can_change
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c95ca64e317f9f49659476b7943b41cb623cfd6a
---
modules/control/hotkeys.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/modules/control/hotkeys.c b/modules/control/hotkeys.c
index 068db5e7f0..40ed470f7e 100644
--- a/modules/control/hotkeys.c
+++ b/modules/control/hotkeys.c
@@ -202,9 +202,12 @@ static void ChangeVout( intf_thread_t *p_intf, vout_thread_t *p_vout )
b_vrnav_can_change = var_GetBool( p_vout, "viewpoint-changeable" );
}
- vlc_mutex_lock( &p_sys->lock );
vout_thread_t *p_old_vout = p_sys->p_vout;
- bool b_vrnav_could_change = p_sys->vrnav.b_can_change;
+ if( p_old_vout != NULL && p_sys->vrnav.b_can_change )
+ var_DelCallback( p_old_vout, "viewpoint-moved", ViewpointMovedEvent,
+ p_intf );
+
+ vlc_mutex_lock( &p_sys->lock );
p_sys->p_vout = p_vout;
if( p_vout != NULL )
{
@@ -217,10 +220,6 @@ static void ChangeVout( intf_thread_t *p_intf, vout_thread_t *p_vout )
if( p_old_vout != NULL )
{
- if( b_vrnav_could_change )
- var_DelCallback( p_old_vout, "viewpoint-moved", ViewpointMovedEvent,
- p_intf );
-
var_DelCallback( p_old_vout, "mouse-button-down", ButtonEvent,
p_intf );
var_DelCallback( p_old_vout, "mouse-moved", MovedEvent, p_intf );
More information about the vlc-commits
mailing list