]> git.sesse.net Git - vlc/blobdiff - src/config/core.c
Use var_Inherit* instead of var_CreateGet*.
[vlc] / src / config / core.c
index b32577c1e61398bef2b1fe4253c2954b8437fa7e..b84bf922a45a7a3df1d40073ba288420d24b227c 100644 (file)
@@ -26,7 +26,9 @@
 #endif
 
 #include <vlc_common.h>
-#include "vlc_keys.h"
+#include <vlc_keys.h>
+#include <vlc_modules.h>
+
 #include "vlc_configuration.h"
 
 #include <assert.h>
@@ -141,7 +143,7 @@ int config_GetType( vlc_object_t *p_this, const char *psz_name )
  * represented by an integer (CONFIG_ITEM_INTEGER and
  * CONFIG_ITEM_BOOL).
  *****************************************************************************/
-int config_GetInt( vlc_object_t *p_this, const char *psz_name )
+int64_t config_GetInt( vlc_object_t *p_this, const char *psz_name )
 {
     module_config_t *p_config;
 
@@ -160,7 +162,7 @@ int config_GetInt( vlc_object_t *p_this, const char *psz_name )
         return -1;
     }
 
-    int val;
+    int64_t val;
 
     vlc_rwlock_rdlock (&config_lock);
     val = p_config->value.i;
@@ -306,7 +308,8 @@ void config_PutPsz( vlc_object_t *p_this,
  * represented by an integer (CONFIG_ITEM_INTEGER and
  * CONFIG_ITEM_BOOL).
  *****************************************************************************/
-void config_PutInt( vlc_object_t *p_this, const char *psz_name, int i_value )
+void config_PutInt( vlc_object_t *p_this, const char *psz_name,
+                    int64_t i_value )
 {
     module_config_t *p_config;
     vlc_value_t oldval;
@@ -326,12 +329,9 @@ void config_PutInt( vlc_object_t *p_this, const char *psz_name, int i_value )
         return;
     }
 
-    /* if i_min == i_max == 0, then do not use them */
-    if ((p_config->min.i == 0) && (p_config->max.i == 0))
-        ;
-    else if (i_value < p_config->min.i)
+    if (i_value < p_config->min.i)
         i_value = p_config->min.i;
-    else if (i_value > p_config->max.i)
+    if (i_value > p_config->max.i)
         i_value = p_config->max.i;
 
     vlc_rwlock_wrlock (&config_lock);