[vlc-commits] remoteosd: only register mouse event callback when needed
Rémi Denis-Courmont
git at videolan.org
Thu Jul 9 20:34:18 CEST 2015
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Jul 9 20:53:19 2015 +0300| [756152611fcf45775b6921bf6d7c1f06cc6d51df] | committer: Rémi Denis-Courmont
remoteosd: only register mouse event callback when needed
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=756152611fcf45775b6921bf6d7c1f06cc6d51df
---
modules/video_filter/remoteosd.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/modules/video_filter/remoteosd.c b/modules/video_filter/remoteosd.c
index a644187..11dbd64 100644
--- a/modules/video_filter/remoteosd.c
+++ b/modules/video_filter/remoteosd.c
@@ -201,7 +201,6 @@ struct filter_sys_t
char *psz_passwd; /* VNC password */
- bool b_vnc_mouse_events; /* Send MouseEvents ? */
bool b_vnc_key_events; /* Send KeyEvents ? */
vlc_mutex_t lock; /* To lock for read/write on picture */
@@ -265,15 +264,11 @@ static int CreateFilter ( vlc_object_t *p_this )
p_sys->ar_color_table_yuv[i][3] = 255;
}
- p_sys->b_vnc_mouse_events = var_CreateGetBoolCommand( p_this,
- RMTOSD_CFG "mouse-events" );
-
/* Keep track of OSD Events */
p_sys->b_need_update = false;
/* Attach subpicture source callback */
p_filter->pf_sub_source = Filter;
- p_filter->pf_sub_mouse = MouseEvent;
es_format_Init( &p_filter->fmt_out, SPU_ES, VLC_CODEC_SPU );
p_filter->fmt_out.i_priority = ES_PRIORITY_SELECTABLE_MIN;
@@ -288,6 +283,9 @@ static int CreateFilter ( vlc_object_t *p_this )
goto error;
}
+ if( var_InheritBool( p_this, RMTOSD_CFG "mouse-events" ) )
+ p_filter->pf_sub_mouse = MouseEvent;
+
p_sys->b_vnc_key_events = var_InheritBool( p_this,
RMTOSD_CFG "key-events" );
if( p_sys->b_vnc_key_events )
@@ -326,7 +324,6 @@ static void DestroyFilter( vlc_object_t *p_this )
var_Destroy( p_this, RMTOSD_CFG "host" );
var_Destroy( p_this, RMTOSD_CFG "password" );
- var_Destroy( p_this, RMTOSD_CFG "mouse-events" );
var_Destroy( p_this, RMTOSD_CFG "alpha" );
vlc_mutex_destroy( &p_sys->lock );
@@ -1203,9 +1200,6 @@ static int MouseEvent( filter_t *p_filter,
filter_sys_t *p_sys = p_filter->p_sys;
VLC_UNUSED(p_old);
- if( !p_sys->b_vnc_mouse_events )
- return VLC_SUCCESS;
-
int i_v = p_new->i_pressed;
int i_x = p_new->i_x;
int i_y = p_new->i_y;
More information about the vlc-commits
mailing list