[vlc-commits] sout: remove sout_stream_t.p_sout

Rémi Denis-Courmont git at videolan.org
Sun Oct 11 15:24:03 CEST 2020


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Oct 10 15:44:52 2020 +0300| [3ddd80bde4f9451883434ab380b80fc4dd6ef41a] | committer: Rémi Denis-Courmont

sout: remove sout_stream_t.p_sout

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

 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 d019a30247..cfbd874edf 100644
--- a/modules/stream_out/chromecast/cast.cpp
+++ b/modules/stream_out/chromecast/cast.cpp
@@ -1232,6 +1232,7 @@ static const struct sout_stream_operations ops = {
  *****************************************************************************/
 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;
@@ -1295,11 +1296,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;



More information about the vlc-commits mailing list