]> git.sesse.net Git - vlc/commitdiff
Remove buggy and never used VLC_VAR_INHERITVALUE
authorRémi Denis-Courmont <remi@remlab.net>
Tue, 29 Dec 2009 14:09:13 +0000 (16:09 +0200)
committerRémi Denis-Courmont <remi@remlab.net>
Tue, 29 Dec 2009 14:10:05 +0000 (16:10 +0200)
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.

include/vlc_variables.h
src/misc/variables.c

index 21c32f3ecce1f57d22710e551fbb8d39c5b77b68..217d7c7472d7a68f57edeb59667e36e7ddb13bcd 100644 (file)
 #define VLC_VAR_GETLIST             0x0025
 #define VLC_VAR_CHOICESCOUNT        0x0026
 
-#define VLC_VAR_INHERITVALUE        0x0030
-
 #define VLC_VAR_SETISCOMMAND        0x0040
 /**@}*/
 
index 7edd00db5a64d582165839d36c2eb1f0888ad61f..45d8a24faeab7ee9ad915ea3d3cc36de3279a278 100644 (file)
@@ -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;