[vlc-commits] stream_filter: privatize module pointer

Rémi Denis-Courmont git at videolan.org
Fri Apr 6 20:05:09 CEST 2018


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Apr  6 20:37:43 2018 +0300| [e38642a8d3930010202037eebd6b7dae7f5403b5] | committer: Rémi Denis-Courmont

stream_filter: privatize module pointer

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

 src/input/stream_filter.c | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/src/input/stream_filter.c b/src/input/stream_filter.c
index fc06dcd56a..a14d34dd5e 100644
--- a/src/input/stream_filter.c
+++ b/src/input/stream_filter.c
@@ -34,9 +34,16 @@
 
 #include "stream.h"
 
+struct vlc_stream_filter_private
+{
+    module_t *module;
+};
+
 static void StreamDelete(stream_t *s)
 {
-    module_unneed(s, s->p_module);
+    struct vlc_stream_filter_private *priv = vlc_stream_Private(s);
+
+    module_unneed(s, priv->module);
     vlc_stream_Delete(s->s);
     free(s->psz_filepath);
 }
@@ -44,14 +51,15 @@ static void StreamDelete(stream_t *s)
 stream_t *vlc_stream_FilterNew( stream_t *p_source,
                                 const char *psz_stream_filter )
 {
-    stream_t *s;
-    assert( p_source != NULL );
+    assert(p_source != NULL);
 
-    s = vlc_stream_CustomNew(p_source->obj.parent, StreamDelete, 0,
-                             "stream filter");
+    struct vlc_stream_filter_private *priv;
+    stream_t *s = vlc_stream_CustomNew(p_source->obj.parent, StreamDelete,
+                                       sizeof (*priv), "stream filter");
     if( s == NULL )
         return NULL;
 
+    priv = vlc_stream_Private(s);
     s->p_input = p_source->p_input;
 
     if( p_source->psz_url != NULL )
@@ -66,8 +74,8 @@ stream_t *vlc_stream_FilterNew( stream_t *p_source,
     s->s = p_source;
 
     /* */
-    s->p_module = module_need( s, "stream_filter", psz_stream_filter, true );
-    if( s->p_module == NULL )
+    priv->module = module_need(s, "stream_filter", psz_stream_filter, true);
+    if (priv->module == NULL)
         goto error;
 
     return s;



More information about the vlc-commits mailing list