예제 #1
0
void input_resource_Terminate( input_resource_t *p_resource )
{
    input_resource_TerminateSout( p_resource );

    vlc_mutex_lock( &p_resource->lock );
    TerminateAout( p_resource );
    vlc_mutex_unlock( &p_resource->lock );

    input_resource_TerminateVout( p_resource );
}
예제 #2
0
static int LoopInput( playlist_t *p_playlist )
{
    playlist_private_t *p_sys = pl_priv(p_playlist);
    input_thread_t *p_input = p_sys->p_input;

    if( !p_input )
        return VLC_EGENERIC;

    if( ( p_sys->request.b_request || !vlc_object_alive( p_playlist ) ) && !p_input->b_die )
    {
        PL_DEBUG( "incoming request - stopping current input" );
        input_Stop( p_input, true );
    }

    /* This input is dead. Remove it ! */
    if( p_input->b_dead )
    {
        PL_DEBUG( "dead input" );

        PL_UNLOCK;
        /* We can unlock as we return VLC_EGENERIC (no event will be lost) */

        /* input_resource_t must be manipulated without playlist lock */
        if( !var_CreateGetBool( p_input, "sout-keep" ) )
            input_resource_TerminateSout( p_sys->p_input_resource );

        /* The DelCallback must be issued without playlist lock */
        var_DelCallback( p_input, "intf-event", InputEvent, p_playlist );

        PL_LOCK;

        p_sys->p_input = NULL;
        input_Close( p_input );

        UpdateActivity( p_playlist, -DEFAULT_INPUT_ACTIVITY );

        return VLC_EGENERIC;
    }
    /* This input is dying, let it do */
    else if( p_input->b_die )
    {
        PL_DEBUG( "dying input" );
    }
    /* This input has finished, ask it to die ! */
    else if( p_input->b_error || p_input->b_eof )
    {
        PL_DEBUG( "finished input" );
        input_Stop( p_input, false );
    }
    return VLC_SUCCESS;
}
예제 #3
0
파일: thread.c 프로젝트: Kubink/vlc
static void LoopInput( playlist_t *p_playlist )
{
    playlist_private_t *p_sys = pl_priv(p_playlist);
    input_thread_t *p_input = p_sys->p_input;

    assert( p_input != NULL );

    if( p_sys->request.b_request || p_sys->killed )
    {
        PL_DEBUG( "incoming request - stopping current input" );
        input_Stop( p_input, true );
    }

#warning Unsynchronized access to *p_input flags...
    /* This input is dead. Remove it ! */
    if( p_input->b_dead )
    {
        p_sys->p_input = NULL;
        PL_DEBUG( "dead input" );
        PL_UNLOCK;

        var_SetAddress( p_playlist, "input-current", NULL );

        /* WARNING: Input resource manipulation and callback deletion are
         * incompatible with the playlist lock. */
        if( !var_InheritBool( p_input, "sout-keep" ) )
            input_resource_TerminateSout( p_sys->p_input_resource );
        var_DelCallback( p_input, "intf-event", InputEvent, p_playlist );

        input_Close( p_input );
        var_TriggerCallback( p_playlist, "activity" );
        PL_LOCK;
        return;
    }
    /* This input has finished, ask it to die ! */
    else if( p_input->b_error || p_input->b_eof )
    {
        PL_DEBUG( "finished input" );
        input_Stop( p_input, false );
    }

    vlc_cond_wait( &p_sys->signal, &p_sys->lock );
}
예제 #4
0
파일: thread.c 프로젝트: 0xheart0/vlc
static void LoopInput( playlist_t *p_playlist )
{
    playlist_private_t *p_sys = pl_priv(p_playlist);
    input_thread_t *p_input = p_sys->p_input;

    assert( p_input != NULL );

    if( p_sys->request.b_request || p_sys->killed )
    {
        PL_DEBUG( "incoming request - stopping current input" );
        input_Stop( p_input );
    }

    switch( var_GetInteger( p_input, "state" ) )
    {
    case END_S:
    case ERROR_S:
    /* This input is dead. Remove it ! */
        p_sys->p_input = NULL;
        PL_DEBUG( "dead input" );
        PL_UNLOCK;

        var_SetAddress( p_playlist, "input-current", NULL );

        /* WARNING: Input resource manipulation and callback deletion are
         * incompatible with the playlist lock. */
        if( !var_InheritBool( p_input, "sout-keep" ) )
            input_resource_TerminateSout( p_sys->p_input_resource );
        var_DelCallback( p_input, "intf-event", InputEvent, p_playlist );

        input_Close( p_input );
        PL_LOCK;
        break;
    default:
        vlc_cond_wait( &p_sys->signal, &p_sys->lock );
    }
}
예제 #5
0
void input_resource_Terminate( input_resource_t *p_resource )
{
    input_resource_TerminateSout( p_resource );
    input_resource_ResetAout( p_resource );
    input_resource_TerminateVout( p_resource );
}