[vlc-devel] commit: Remove buggy and never used VLC_VAR_INHERITVALUE ( Rémi Denis-Courmont )

git version control git at videolan.org
Tue Dec 29 15:12:07 CET 2009


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Dec 29 16:09:13 2009 +0200| [c85d607420db8a3fc1025c3f4dee268cb533070b] | committer: Rémi Denis-Courmont 

Remove buggy and never used VLC_VAR_INHERITVALUE

InheritValue() is not thread-safe. It runs under the variable lock of
the object creating the new variabe. But it reads variables of parent
objects. This would require the variable lock of the parent object.

We still need to fix var_Create() with VLC_VAR_DOINHERIT.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c85d607420db8a3fc1025c3f4dee268cb533070b
---

 include/vlc_variables.h |    2 --
 src/misc/variables.c    |   29 -----------------------------
 2 files changed, 0 insertions(+), 31 deletions(-)

diff --git a/include/vlc_variables.h b/include/vlc_variables.h
index 21c32f3..217d7c7 100644
--- a/include/vlc_variables.h
+++ b/include/vlc_variables.h
@@ -110,8 +110,6 @@
 #define VLC_VAR_GETLIST             0x0025
 #define VLC_VAR_CHOICESCOUNT        0x0026
 
-#define VLC_VAR_INHERITVALUE        0x0030
-
 #define VLC_VAR_SETISCOMMAND        0x0040
 /**@}*/
 
diff --git a/src/misc/variables.c b/src/misc/variables.c
index 7edd00d..45d8a24 100644
--- a/src/misc/variables.c
+++ b/src/misc/variables.c
@@ -627,35 +627,6 @@ int __var_Change( vlc_object_t *p_this, const char *psz_name,
             p_val->psz_string = p_var->psz_text ? strdup( p_var->psz_text )
                                                 : NULL;
             break;
-        case VLC_VAR_INHERITVALUE:
-            {
-                vlc_value_t val;
-
-                if( InheritValue( p_this,
-                                  p_val2 ? p_val2->psz_string :  psz_name,
-                                  &val, p_var->i_type )
-                    == VLC_SUCCESS )
-                {
-                    /* Duplicate already done */
-
-                    /* Backup needed stuff */
-                    oldval = p_var->val;
-                    /* Check boundaries and list */
-                    CheckValue( p_var, &val );
-                    /* Set the variable */
-                    p_var->val = val;
-                    /* Free data if needed */
-                    p_var->ops->pf_free( &oldval );
-                }
-
-                if( p_val )
-                {
-                    *p_val = p_var->val;
-                    p_var->ops->pf_dup( p_val );
-                }
-            }
-            break;
-
         case VLC_VAR_SETISCOMMAND:
             p_var->i_type |= VLC_VAR_ISCOMMAND;
             break;




More information about the vlc-devel mailing list