Пример #1
0
/* Enqueue an item for preparsing, and play it, if needed */
static void GoAndPreparse( playlist_t *p_playlist, int i_mode,
                           playlist_item_t *p_item )
{
    playlist_private_t *sys = pl_priv(p_playlist);

    PL_ASSERT_LOCKED;
    if( (i_mode & PLAYLIST_GO ) )
    {
        sys->request.b_request = true;
        sys->request.i_skip = 0;
        sys->request.p_item = p_item;
        if( sys->p_input != NULL )
            input_Stop( sys->p_input, true );
        sys->request.i_status = PLAYLIST_RUNNING;
        vlc_cond_signal( &sys->signal );
    }
    /* Preparse if no artist/album info, and hasn't been preparsed allready
       and if user has some preparsing option (auto-preparse variable)
       enabled*/
    char *psz_artist = input_item_GetArtist( p_item->p_input );
    char *psz_album = input_item_GetAlbum( p_item->p_input );
    if( sys->p_preparser != NULL && !input_item_IsPreparsed( p_item->p_input )
     && (EMPTY_STR(psz_artist) || EMPTY_STR(psz_album)) )
        playlist_preparser_Push( sys->p_preparser, p_item->p_input, 0 );
    free( psz_artist );
    free( psz_album );
}
Пример #2
0
/**
 * Requests extraction of the meta data for an input item (a.k.a. preparsing).
 * The actual extraction is asynchronous.
 */
int libvlc_MetaRequest(libvlc_int_t *libvlc, input_item_t *item)
{
    libvlc_priv_t *priv = libvlc_priv(libvlc);

    if (unlikely(priv->parser == NULL))
        return VLC_ENOMEM;

    playlist_preparser_Push(priv->parser, item);
    return VLC_SUCCESS;
}
Пример #3
0
/**
 * Requests extraction of the meta data for an input item (a.k.a. preparsing).
 * The actual extraction is asynchronous.
 */
int libvlc_MetaRequest(libvlc_int_t *libvlc, input_item_t *item,
                       input_item_meta_request_option_t i_options)
{
    libvlc_priv_t *priv = libvlc_priv(libvlc);

    if (unlikely(priv->parser == NULL))
        return VLC_ENOMEM;

    vlc_mutex_lock( &item->lock );
    if( item->i_preparse_depth == 0 )
        item->i_preparse_depth = 1;
    vlc_mutex_unlock( &item->lock );
    playlist_preparser_Push(priv->parser, item, i_options);
    return VLC_SUCCESS;
}
Пример #4
0
/**
 * Requests extraction of the meta data for an input item (a.k.a. preparsing).
 * The actual extraction is asynchronous. It can be cancelled with
 * libvlc_MetadataCancel()
 */
int libvlc_MetadataRequest(libvlc_int_t *libvlc, input_item_t *item,
                           input_item_meta_request_option_t i_options,
                           int timeout, void *id)
{
    libvlc_priv_t *priv = libvlc_priv(libvlc);

    if (unlikely(priv->parser == NULL))
        return VLC_ENOMEM;

    vlc_mutex_lock( &item->lock );
    if( item->i_preparse_depth == 0 )
        item->i_preparse_depth = 1;
    if( i_options & META_REQUEST_OPTION_DO_INTERACT )
        item->b_preparse_interact = true;
    vlc_mutex_unlock( &item->lock );
    playlist_preparser_Push( priv->parser, item, i_options, timeout, id );
    return VLC_SUCCESS;
}