Commit 085fe545 authored by Laurent Aimar's avatar Laurent Aimar

Used input_Create+input_Start in vlm.

When a callback on int-event is needed, it is a bit cleaner.
parent f89d6ff9
...@@ -569,14 +569,18 @@ static int vlm_OnMediaUpdate( vlm_t *p_vlm, vlm_media_sys_t *p_media ) ...@@ -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 ) if( asprintf( &psz_header, _("Media: %s"), p_cfg->psz_name ) == -1 )
psz_header = NULL; 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_t sem_preparse;
vlc_sem_init( &sem_preparse, 0 ); vlc_sem_init( &sem_preparse, 0 );
var_AddCallback( p_input, "intf-event", InputEventPreparse, &sem_preparse ); var_AddCallback( p_input, "intf-event", InputEventPreparse, &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 ) ) ) while( !p_input->b_dead && ( !p_cfg->vod.psz_mux || !input_item_IsPreparsed( p_media->vod.p_item ) ) )
vlc_sem_wait( &sem_preparse ); vlc_sem_wait( &sem_preparse );
}
var_DelCallback( p_input, "intf-event", InputEventPreparse, &sem_preparse ); var_DelCallback( p_input, "intf-event", InputEventPreparse, &sem_preparse );
vlc_sem_destroy( &sem_preparse ); vlc_sem_destroy( &sem_preparse );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment