]> git.sesse.net Git - vlc/blobdiff - src/config/core.c
mozilla: activex: add cache filling level to event MediaPlayerBuffering
[vlc] / src / config / core.c
index 24925efa8ea6bc4a3a6fcc1077ae7da40036c264..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;
@@ -253,7 +255,7 @@ void config_PutPsz( vlc_object_t *p_this,
                       const char *psz_name, const char *psz_value )
 {
     module_config_t *p_config;
-    vlc_value_t oldval, val;
+    vlc_value_t oldval;
 
     p_config = config_FindConfig( p_this, psz_name );
 
@@ -283,13 +285,13 @@ void config_PutPsz( vlc_object_t *p_this,
 
     p_config->value.psz = str;
     p_config->b_dirty = true;
-
-    val.psz_string = (char *)p_config->value.psz;
-
     vlc_rwlock_unlock (&config_lock);
 
     if( p_config->pf_callback )
     {
+        vlc_value_t val;
+
+        val.psz_string = (char *)psz_value;
         p_config->pf_callback( p_this, psz_name, oldval, val,
                                p_config->p_callback_data );
     }
@@ -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);