[vlc-commits] VLM: create input resource immediately for each instance

Rémi Denis-Courmont git at videolan.org
Wed Oct 31 21:59:48 CET 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Oct 31 22:59:35 2012 +0200| [1925313da23e72dbf7e7c69e63e1547c9bfd8bc4] | committer: Rémi Denis-Courmont

VLM: create input resource immediately for each instance

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

 src/input/vlm.c |   12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/src/input/vlm.c b/src/input/vlm.c
index 0b980be..29c016e 100644
--- a/src/input/vlm.c
+++ b/src/input/vlm.c
@@ -900,7 +900,7 @@ static vlm_media_instance_sys_t *vlm_MediaInstanceNew( vlm_t *p_vlm, const char
     p_instance->b_sout_keep = false;
     p_instance->p_parent = vlc_object_create( p_vlm, sizeof (vlc_object_t) );
     p_instance->p_input = NULL;
-    p_instance->p_input_resource = NULL;
+    p_instance->p_input_resource = input_resource_New( VLC_OBJECT(p_vlm) );
 
     return p_instance;
 }
@@ -916,11 +916,8 @@ static void vlm_MediaInstanceDelete( vlm_t *p_vlm, int64_t id, vlm_media_instanc
 
         vlm_SendEventMediaInstanceStopped( p_vlm, id, p_media->cfg.psz_name );
     }
-    if( p_instance->p_input_resource )
-    {
-        input_resource_Terminate( p_instance->p_input_resource );
-        input_resource_Release( p_instance->p_input_resource );
-    }
+    input_resource_Terminate( p_instance->p_input_resource );
+    input_resource_Release( p_instance->p_input_resource );
     vlc_object_release( p_instance->p_parent );
 
     TAB_REMOVE( p_media->i_instance, p_media->instance, p_instance );
@@ -1030,9 +1027,6 @@ static int vlm_ControlMediaInstanceStart( vlm_t *p_vlm, int64_t id, const char *
 
     if( asprintf( &psz_log, _("Media: %s"), p_media->cfg.psz_name ) != -1 )
     {
-        if( !p_instance->p_input_resource )
-            p_instance->p_input_resource = input_resource_New( p_instance->p_parent );
-
         p_instance->p_input = input_Create( p_instance->p_parent,
                                             p_instance->p_item, psz_log,
                                             p_instance->p_input_resource );



More information about the vlc-commits mailing list