[vlc-devel] [PATCH 23/23] sout: remove sout_stream_t.p_sout

RĂ©mi Denis-Courmont remi at remlab.net
Sat Oct 10 14:55:47 CEST 2020


---
 include/vlc_sout.h                     |  2 --
 modules/stream_out/chromecast/cast.cpp | 14 ++++++++------
 src/stream_output/stream_output.c      |  1 -
 3 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/include/vlc_sout.h b/include/vlc_sout.h
index 5e96451b33..4d9f8225eb 100644
--- a/include/vlc_sout.h
+++ b/include/vlc_sout.h
@@ -186,8 +186,6 @@ struct sout_stream_t
     struct vlc_object_t obj;
 
     module_t          *p_module;
-    vlc_object_t      *p_sout;
-
     char              *psz_name;
     config_chain_t    *p_cfg;
     sout_stream_t     *p_next;
diff --git a/modules/stream_out/chromecast/cast.cpp b/modules/stream_out/chromecast/cast.cpp
index 11ae6339b0..138a5c4990 100644
--- a/modules/stream_out/chromecast/cast.cpp
+++ b/modules/stream_out/chromecast/cast.cpp
@@ -1228,6 +1228,7 @@ static void on_input_event_cb(void *data, enum cc_input_event event, union cc_in
  *****************************************************************************/
 static int Open(vlc_object_t *p_this)
 {
+    vlc_object_t *parent = vlc_object_parent(p_this);
     sout_stream_t *p_stream = reinterpret_cast<sout_stream_t*>(p_this);
     sout_stream_sys_t *p_sys = NULL;
     intf_sys_t *p_intf = NULL;
@@ -1291,11 +1292,11 @@ static int Open(vlc_object_t *p_this)
     p_intf->setOnInputEventCb(on_input_event_cb, p_stream);
 
     /* prevent sout-mux-caching since chromecast-proxy is already doing it */
-    var_Create( p_stream->p_sout, "sout-mux-caching", VLC_VAR_INTEGER );
-    var_SetInteger( p_stream->p_sout, "sout-mux-caching", 0 );
+    var_Create(parent, "sout-mux-caching", VLC_VAR_INTEGER);
+    var_SetInteger(parent, "sout-mux-caching", 0);
 
-    var_Create( p_stream->p_sout, SOUT_CFG_PREFIX "sys", VLC_VAR_ADDRESS );
-    var_SetAddress( p_stream->p_sout, SOUT_CFG_PREFIX "sys", p_sys );
+    var_Create(parent, SOUT_CFG_PREFIX "sys", VLC_VAR_ADDRESS);
+    var_SetAddress(parent, SOUT_CFG_PREFIX "sys", p_sys );
 
     var_Create(p_stream, SOUT_CFG_PREFIX "access-out-sys", VLC_VAR_ADDRESS);
 
@@ -1325,12 +1326,13 @@ error:
  *****************************************************************************/
 static void Close(vlc_object_t *p_this)
 {
+    vlc_object_t *parent = vlc_object_parent(p_this);
     sout_stream_t *p_stream = reinterpret_cast<sout_stream_t*>(p_this);
     sout_stream_sys_t *p_sys = reinterpret_cast<sout_stream_sys_t *>( p_stream->p_sys );
 
     assert(p_sys->out_streams.empty() && p_sys->streams.empty());
-    var_Destroy( p_stream->p_sout, SOUT_CFG_PREFIX "sys" );
-    var_Destroy( p_stream->p_sout, SOUT_CFG_PREFIX "sout-mux-caching" );
+    var_Destroy(parent, SOUT_CFG_PREFIX "sys");
+    var_Destroy(parent, SOUT_CFG_PREFIX "sout-mux-caching");
 
     assert(p_sys->streams.empty() && p_sys->out_streams.empty());
 
diff --git a/src/stream_output/stream_output.c b/src/stream_output/stream_output.c
index 0c6123a051..08dd9ca086 100644
--- a/src/stream_output/stream_output.c
+++ b/src/stream_output/stream_output.c
@@ -798,7 +798,6 @@ static sout_stream_t *sout_StreamNew( vlc_object_t *parent, char *psz_name,
     if( !p_stream )
         return NULL;
 
-    p_stream->p_sout   = parent;
     p_stream->psz_name = psz_name;
     p_stream->p_cfg    = p_cfg;
     p_stream->p_next   = p_next;
-- 
2.28.0



More information about the vlc-devel mailing list