[vlc-devel] [PATCH] ZVBI: remove never invoked callbacks

Stefan Pöschel basic.master at gmx.de
Sat Jan 30 17:28:44 CET 2016


Am 30.01.2016 um 16:41 schrieb Jean-Baptiste Kempf:
> On 30 Jan, Stefan Pöschel wrote :
>> The settings vbi-opaque and vbi-position do not appear on global level. So the
>> regarding variable callbacks are never invoked and therefore can be removed.
>
> opaque not used? That is surprising.
>
>

You are right, vbi-opaque is indeed used - I'm sorry. The vbi-position though is not, therefore I adopted the patch:



The setting vbi-position does not appear on global level. Thus the regarding
variable callback is never invoked and therefore can be removed.
---
 modules/codec/zvbi.c | 18 ------------------
 1 file changed, 18 deletions(-)

diff --git a/modules/codec/zvbi.c b/modules/codec/zvbi.c
index 4d4eaa2..2dd140c 100644
--- a/modules/codec/zvbi.c
+++ b/modules/codec/zvbi.c
@@ -178,8 +178,6 @@ static int RequestPage( vlc_object_t *p_this, char const *psz_cmd,
                         vlc_value_t oldval, vlc_value_t newval, void *p_data );
 static int Opaque( vlc_object_t *p_this, char const *psz_cmd,
                    vlc_value_t oldval, vlc_value_t newval, void *p_data );
-static int Position( vlc_object_t *p_this, char const *psz_cmd,
-                     vlc_value_t oldval, vlc_value_t newval, void *p_data );
 static int EventKey( vlc_object_t *p_this, char const *psz_cmd,
                      vlc_value_t oldval, vlc_value_t newval, void *p_data );

@@ -250,10 +248,8 @@ static int Open( vlc_object_t *p_this )
     var_AddCallback( p_dec, "vbi-opaque", Opaque, p_sys );

     p_sys->i_align = var_CreateGetInteger( p_dec, "vbi-position" );
-    var_AddCallback( p_dec, "vbi-position", Position, p_sys );

     p_sys->b_text = var_CreateGetBool( p_dec, "vbi-text" );
-//    var_AddCallback( p_dec, "vbi-text", Text, p_sys );

     /* Listen for keys */
     var_AddCallback( p_dec->p_libvlc, "key-pressed", EventKey, p_dec );
@@ -276,7 +272,6 @@ static void Close( vlc_object_t *p_this )
     decoder_t     *p_dec = (decoder_t*) p_this;
     decoder_sys_t *p_sys = p_dec->p_sys;

-    var_DelCallback( p_dec, "vbi-position", Position, p_sys );
     var_DelCallback( p_dec, "vbi-opaque", Opaque, p_sys );
     var_DelCallback( p_dec, "vbi-page", RequestPage, p_sys );
     var_DelCallback( p_dec->p_libvlc, "key-pressed", EventKey, p_dec );
@@ -725,19 +720,6 @@ static int Opaque( vlc_object_t *p_this, char const *psz_cmd,
     return VLC_SUCCESS;
 }

-static int Position( vlc_object_t *p_this, char const *psz_cmd,
-                     vlc_value_t oldval, vlc_value_t newval, void *p_data )
-{
-    decoder_sys_t *p_sys = p_data;
-    VLC_UNUSED(p_this); VLC_UNUSED(psz_cmd); VLC_UNUSED(oldval);
-
-    vlc_mutex_lock( &p_sys->lock );
-    p_sys->i_align = newval.i_int;
-    vlc_mutex_unlock( &p_sys->lock );
-
-    return VLC_SUCCESS;
-}
-
 static int EventKey( vlc_object_t *p_this, char const *psz_cmd,
                         vlc_value_t oldval, vlc_value_t newval, void *p_data )
 {
-- 
2.7.0


More information about the vlc-devel mailing list