[vlc-commits] libvlc: do not cache "stats" value

Rémi Denis-Courmont git at videolan.org
Tue Dec 12 19:36:53 CET 2017


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Dec 12 18:59:00 2017 +0200| [2a05a1ff461cff4f8421d821325e882b7252ec91] | committer: Rémi Denis-Courmont

libvlc: do not cache "stats" value

There are no reasons why it couldn´t change between two inputs.

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

 src/input/input.c | 2 +-
 src/libvlc.c      | 2 --
 src/libvlc.h      | 5 -----
 3 files changed, 1 insertion(+), 8 deletions(-)

diff --git a/src/input/input.c b/src/input/input.c
index 91346d2455..7255a24506 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -473,7 +473,7 @@ static input_thread_t *Create( vlc_object_t *p_parent, input_item_t *p_item,
 
     /* */
     struct input_stats *stats = NULL;
-    if( !priv->b_preparsing && libvlc_stats(p_input) )
+    if( !priv->b_preparsing && var_InheritBool( p_input, "stats" ) )
     {
         stats = malloc( sizeof (*stats) );
         if( likely(stats != NULL) )
diff --git a/src/libvlc.c b/src/libvlc.c
index 7e343a6365..c9e594a0d9 100644
--- a/src/libvlc.c
+++ b/src/libvlc.c
@@ -229,8 +229,6 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
 
     vlc_CPU_dump( VLC_OBJECT(p_libvlc) );
 
-    priv->b_stats = var_InheritBool( p_libvlc, "stats" );
-
     /*
      * Initialize hotkey handling
      */
diff --git a/src/libvlc.h b/src/libvlc.h
index 1a64ab96a8..1741238da3 100644
--- a/src/libvlc.h
+++ b/src/libvlc.h
@@ -178,9 +178,6 @@ typedef struct libvlc_priv_t
 {
     libvlc_int_t       public_data;
 
-    /* Logging */
-    bool               b_stats;     ///< Whether to collect stats
-
     /* Singleton objects */
     vlc_logger_t      *logger;
     vlm_t             *p_vlm;  ///< the VLM singleton (or NULL)
@@ -203,8 +200,6 @@ int intf_InsertItem(libvlc_int_t *, const char *mrl, unsigned optc,
                     const char * const *optv, unsigned flags);
 void intf_DestroyAll( libvlc_int_t * );
 
-#define libvlc_stats( o ) (libvlc_priv((VLC_OBJECT(o))->obj.libvlc)->b_stats)
-
 /*
  * Variables stuff
  */



More information about the vlc-commits mailing list