示例#1
0
void libvlc_playlist_prev( libvlc_instance_t *p_instance,
                           libvlc_exception_t *p_e )
{
    if( playlist_Control( PL, PLAYLIST_SKIP, playlist_was_locked( p_instance ),
                          -1  ) != VLC_SUCCESS )
        RAISEVOID( "Empty playlist" );
}
示例#2
0
void libvlc_playlist_play( libvlc_instance_t *p_instance, int i_id,
                           int i_options, char **ppsz_options,
                           libvlc_exception_t *p_e )
{
    VLC_UNUSED(p_e); VLC_UNUSED(i_options); VLC_UNUSED(ppsz_options);

    int did_lock = 0;
    assert( PL );
    ///\todo Handle additionnal options

    if( PL->items.i_size == 0 ) RAISEVOID( "Empty playlist" );
    if( i_id > 0 )
    {
        playlist_item_t *p_item;
        if (! playlist_was_locked( p_instance ) )
        {
            playlist_mark_locked( p_instance, 1 );
            vlc_object_lock( PL );
            did_lock = 1;
        }

        p_item = playlist_ItemGetByInputId( PL, i_id,
                                            PL->status.p_node );
        if( !p_item )
        {
            if( did_lock == 1 )
            {
                vlc_object_unlock( PL );
                playlist_mark_locked( p_instance, 0 );
            }
            RAISEVOID( "Unable to find item" );
        }

        playlist_Control( PL, PLAYLIST_VIEWPLAY, pl_Locked,
                          PL->status.p_node, p_item );
        if( did_lock == 1 )
        {
            vlc_object_unlock( PL );
            playlist_mark_locked( p_instance, 0 );
        }
    }
    else
    {
        playlist_Control( PL, PLAYLIST_PLAY,
                          playlist_was_locked( p_instance ) );
    }
}
示例#3
0
void libvlc_playlist_stop( libvlc_instance_t *p_instance,
                           libvlc_exception_t *p_e )
{
    assert( PL );
    if( playlist_Control( PL, PLAYLIST_STOP,
                          playlist_was_locked( p_instance ) ) != VLC_SUCCESS )
        RAISEVOID( "Empty playlist" );
}
示例#4
0
文件: log.c 项目: mahaserver/MHSVLC
void libvlc_log_iterator_free( libvlc_log_iterator_t *p_iter, libvlc_exception_t *p_e )
{
    if( p_iter )
    {
        free(p_iter);
    }
    else
        RAISEVOID("Invalid log iterator!");
}
示例#5
0
文件: log.c 项目: mahaserver/MHSVLC
void libvlc_set_log_verbosity( libvlc_instance_t *p_instance, unsigned level, libvlc_exception_t *p_e )
{
    if( p_instance )
    {
        libvlc_priv_t *p_priv = libvlc_priv( p_instance->p_libvlc_int );
        p_priv->i_verbose = level;
    }
    else
        RAISEVOID("Invalid VLC instance!");
}
示例#6
0
文件: log.c 项目: mahaserver/MHSVLC
void libvlc_log_close( libvlc_log_t *p_log, libvlc_exception_t *p_e )
{
    if( p_log && p_log->p_messages )
    {
        msg_Unsubscribe(p_log->p_instance->p_libvlc_int, p_log->p_messages);
        libvlc_release( p_log->p_instance );
        free(p_log);
    }
    else
        RAISEVOID("Invalid log object!");
}
示例#7
0
文件: log.c 项目: mahaserver/MHSVLC
void libvlc_log_clear( libvlc_log_t *p_log, libvlc_exception_t *p_e )
{
    if( p_log && p_log->p_messages )
    {
        vlc_mutex_lock(p_log->p_messages->p_lock);
        p_log->p_messages->i_start = *(p_log->p_messages->pi_stop);
        vlc_mutex_unlock(p_log->p_messages->p_lock);
    }
    else
        RAISEVOID("Invalid log object!");
}
示例#8
0
文件: log.c 项目: Kafay/vlc
void libvlc_log_close( libvlc_log_t *p_log, libvlc_exception_t *p_e )
{
    if( p_log )
    {
        assert( p_log->p_messages );
        msg_Unsubscribe(p_log->p_messages);
        libvlc_release( p_log->p_instance );
        libvlc_log_clear( p_log, p_e );
        vlc_spin_destroy( &p_log->data.lock );
        free(p_log);
    }
    else
        RAISEVOID("Invalid log object!");
}
示例#9
0
文件: log.c 项目: Kafay/vlc
void libvlc_log_clear( libvlc_log_t *p_log, libvlc_exception_t *p_e )
{
    if( p_log )
    {
        vlc_spin_lock (&p_log->data.lock);
        msg_item_t *tab[p_log->data.count];
        memcpy (tab, p_log->data.items, sizeof (tab));
        p_log->data.count = 0;
        vlc_spin_unlock (&p_log->data.lock);

        for (unsigned i = 0; i < sizeof (tab) / sizeof (tab[0]); i++)
            msg_Release (tab[i]);
    }
    else
        RAISEVOID("Invalid log object!");
}