[vlc-devel] commit: Used input_Create+input_Start in vlm. (Laurent Aimar )

git version control git at videolan.org
Mon Sep 14 23:27:58 CEST 2009


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Mon Sep 14 20:38:16 2009 +0200| [085fe545294c7de477245b68ab6c7fe7a35ace93] | committer: Laurent Aimar 

Used input_Create+input_Start in vlm.

When a callback on int-event is needed, it is a bit cleaner.

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

 src/input/vlm.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/input/vlm.c b/src/input/vlm.c
index 7fb098d..9440ac2 100644
--- a/src/input/vlm.c
+++ b/src/input/vlm.c
@@ -569,14 +569,18 @@ static int vlm_OnMediaUpdate( vlm_t *p_vlm, vlm_media_sys_t *p_media )
             if( asprintf( &psz_header, _("Media: %s"), p_cfg->psz_name ) == -1 )
                 psz_header = NULL;
 
-            if( (p_input = input_CreateAndStart( p_vlm->p_libvlc, p_media->vod.p_item, psz_header ) ) )
+            p_input = input_Create( p_vlm->p_libvlc, p_media->vod.p_item, psz_header, NULL );
+            if( p_input )
             {
                 vlc_sem_t sem_preparse;
                 vlc_sem_init( &sem_preparse, 0 );
                 var_AddCallback( p_input, "intf-event", InputEventPreparse, &sem_preparse );
 
-                while( !p_input->b_dead && ( !p_cfg->vod.psz_mux || !input_item_IsPreparsed( p_media->vod.p_item ) ) )
-                    vlc_sem_wait( &sem_preparse );
+                if( !input_Start( p_input ) )
+                {
+                    while( !p_input->b_dead && ( !p_cfg->vod.psz_mux || !input_item_IsPreparsed( p_media->vod.p_item ) ) )
+                        vlc_sem_wait( &sem_preparse );
+                }
 
                 var_DelCallback( p_input, "intf-event", InputEventPreparse, &sem_preparse );
                 vlc_sem_destroy( &sem_preparse );




More information about the vlc-devel mailing list