]> git.sesse.net Git - vlc/blobdiff - src/stream_output/stream_output.c
Use var_Inherit* instead of var_CreateGet*.
[vlc] / src / stream_output / stream_output.c
index ab1918dd82161d8c50a1026d8194cb6858e3f275..38b2361186cd45feca2e46726b06207fe09b8f52 100644 (file)
@@ -46,6 +46,7 @@
 #include <vlc_meta.h>
 #include <vlc_block.h>
 #include <vlc_codec.h>
+#include <vlc_modules.h>
 
 #include "input/input_interface.h"
 
@@ -129,7 +130,6 @@ sout_instance_t *__sout_NewInstance( vlc_object_t *p_parent, const char *psz_des
 
     FREENULL( p_sout->psz_sout );
 
-    vlc_object_detach( p_sout );
     vlc_object_release( p_sout );
     return NULL;
 }
@@ -327,7 +327,6 @@ sout_access_out_t *sout_AccessOutNew( vlc_object_t *p_sout,
     {
         free( p_access->psz_access );
         free( p_access->psz_path );
-        vlc_object_detach( p_access );
         vlc_object_release( p_access );
         return( NULL );
     }
@@ -339,7 +338,6 @@ sout_access_out_t *sout_AccessOutNew( vlc_object_t *p_sout,
  *****************************************************************************/
 void sout_AccessOutDelete( sout_access_out_t *p_access )
 {
-    vlc_object_detach( p_access );
     if( p_access->p_module )
     {
         module_unneed( p_access, p_access->p_module );
@@ -449,7 +447,6 @@ sout_mux_t * sout_MuxNew( sout_instance_t *p_sout, const char *psz_mux,
     {
         FREENULL( p_mux->psz_mux );
 
-        vlc_object_detach( p_mux );
         vlc_object_release( p_mux );
         return NULL;
     }
@@ -500,7 +497,6 @@ sout_mux_t * sout_MuxNew( sout_instance_t *p_sout, const char *psz_mux,
  *****************************************************************************/
 void sout_MuxDelete( sout_mux_t *p_mux )
 {
-    vlc_object_detach( p_mux );
     if( p_mux->p_module )
     {
         module_unneed( p_mux, p_mux->p_module );
@@ -798,7 +794,6 @@ static void sout_StreamDelete( sout_stream_t *p_stream )
 {
     msg_Dbg( p_stream, "destroying chain... (name=%s)", p_stream->psz_name );
 
-    vlc_object_detach( p_stream );
     if( p_stream->p_module ) module_unneed( p_stream, p_stream->p_module );
 
     FREENULL( p_stream->psz_name );
@@ -818,13 +813,15 @@ static void sout_StreamDelete( sout_stream_t *p_stream )
  */
 void sout_StreamChainDelete(sout_stream_t *p_first, sout_stream_t *p_last)
 {
-    if(!p_first)
-        return;
-
-    if(p_first != p_last)
-        sout_StreamChainDelete(p_first->p_next, p_last);
+    while(p_first != NULL)
+    {
+        sout_stream_t *p_next = p_first->p_next;
 
-    sout_StreamDelete(p_first);
+        sout_StreamDelete(p_first);
+        if(p_first == p_last)
+           break;
+        p_first = p_next;
+    }
 }
 
 /* Create a "stream_out" module, which may forward its ES to p_next module */
@@ -1007,7 +1004,7 @@ rtp:
     if (psz_chain && b_sout_display)
     {
         char *tmp;
-        if (asprintf (&tmp, "duplicate{dst=display,dst=%s}", tmp) == -1)
+        if (asprintf (&tmp, "duplicate{dst=display,dst=%s}", psz_chain) == -1)
             tmp = NULL;
         free (psz_chain);
         psz_chain = tmp;