• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ pl_Get函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中pl_Get函数的典型用法代码示例。如果您正苦于以下问题:C++ pl_Get函数的具体用法?C++ pl_Get怎么用?C++ pl_Get使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了pl_Get函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: Open

/* Open Interface */
static int Open( vlc_object_t *p_this, bool isDialogProvider )
{
    intf_thread_t *p_intf = (intf_thread_t *)p_this;

#ifdef Q_WS_X11
    if( !vlc_xlib_init( p_this ) )
        return VLC_EGENERIC;

    char *display = var_CreateGetNonEmptyString( p_intf, "x11-display" );
    Display *p_display = XOpenDisplay( x11_display );
    if( !p_display )
    {
        msg_Err( p_intf, "Could not connect to X server" );
        free (display);
        return VLC_EGENERIC;
    }
    XCloseDisplay( p_display );
#else
    char *display = NULL;
#endif

    QMutexLocker locker (&lock);
    if (busy)
    {
        msg_Err (p_this, "cannot start Qt4 multiple times");
        free (display);
        return VLC_EGENERIC;
    }

    /* Allocations of p_sys */
    intf_sys_t *p_sys = p_intf->p_sys = new intf_sys_t;
    p_intf->p_sys->b_isDialogProvider = isDialogProvider;
    p_sys->p_mi = NULL;
    p_sys->p_playlist = pl_Get( p_intf );

    /* */
#ifdef Q_WS_X11
    x11_display = display;
#endif
    vlc_sem_init (&ready, 0);
    if( vlc_clone( &p_sys->thread, Thread, p_intf, VLC_THREAD_PRIORITY_LOW ) )
    {
        delete p_sys;
        free (display);
        return VLC_ENOMEM;
    }

    /* */
    vlc_sem_wait (&ready);
    vlc_sem_destroy (&ready);
    busy = active = true;

    if( !p_sys->b_isDialogProvider )
    {
        playlist_t *pl = pl_Get(p_this);
        var_Create (pl, "qt4-iface", VLC_VAR_ADDRESS);
        var_SetAddress (pl, "qt4-iface", p_this);
    }
    return VLC_SUCCESS;
}
开发者ID:cobr123,项目名称:qtVlc,代码行数:61,代码来源:qt4.cpp


示例2: Open

/*****************************************************************************
 * Open: initialize and create stuff
 *****************************************************************************/
static int Open(vlc_object_t *p_this)
{
    intf_thread_t   *p_intf     = (intf_thread_t*) p_this;
    intf_sys_t      *p_sys      = calloc(1, sizeof(intf_sys_t));

    if (!p_sys)
        return VLC_ENOMEM;

    p_intf->p_sys = p_sys;

    vlc_mutex_init(&p_sys->lock);
    vlc_cond_init(&p_sys->wait);

    if (vlc_clone(&p_sys->thread, Run, p_intf, VLC_THREAD_PRIORITY_LOW))
    {
        vlc_cond_destroy(&p_sys->wait);
        vlc_mutex_destroy(&p_sys->lock);
        free(p_sys);
        return VLC_ENOMEM;
    }

    var_AddCallback(pl_Get(p_intf), "activity", ItemChange, p_intf);

    return VLC_SUCCESS;
}
开发者ID:Kubink,项目名称:vlc,代码行数:28,代码来源:audioscrobbler.c


示例3: EP_SetMoviesoapP_Input

	/* Sets Moviesoap::p_input */
	static void* EP_SetMoviesoapP_Input(void *data)
	{
		// require Moviesoap::p_playlist
		if (Moviesoap::p_playlist == NULL) {
			playlist_t * p_playlist = pl_Get( Moviesoap::p_obj );
			if (p_playlist) {
				vlc_mutex_lock( &Moviesoap::lock );
				Moviesoap::p_playlist = p_playlist;
				vlc_mutex_unlock( &Moviesoap::lock );
			} else {
				return NULL;
			}
		}
		// get p_input
		input_thread_t * p_input = playlist_CurrentInput( p_playlist );
		if (p_input) {
			// set Moviesoap::p_input
			vlc_mutex_lock( &Moviesoap::lock );
			Moviesoap::p_input = p_input;
			vlc_mutex_unlock( &Moviesoap::lock );
			// Add callback(s) to input thread
			var_AddCallback( p_input, "position", InputCbPosition, NULL );
			var_AddCallback( p_input, "time", InputCbTime, NULL );
			var_AddCallback( p_input, "intf-event", InputCbGeneric, NULL );
			var_AddCallback( p_input, "state", InputCbState, NULL );
			// start filter object if one exists
			if (Moviesoap::p_loadedFilter) Moviesoap::p_loadedFilter->Restart();
		}
		return p_input;
	}
开发者ID:entrity,项目名称:moviesoap,代码行数:31,代码来源:callbacks.cpp


示例4: Open

// Initialize interface.
static int Open(vlc_object_t* p_this)
{
	intf_thread_t* const p_intf = (intf_thread_t*)p_this;

	// Limit to one instance.
	if (FindWindow(L"CD Art Display IPC Class", L"VLC"))
	{
		p_intf->p_sys = NULL;
		return VLC_SUCCESS;
	}
	
	OutputDebugString(L"VLC Open");
	intf_sys_t* const p_sys = (intf_sys_t*)calloc(1, sizeof(intf_sys_t));
	if (!p_sys)
	{
		return VLC_ENOMEM;
	}
	p_intf->p_sys = p_sys;

	vlc_mutex_init(&p_sys->lock);

	if (vlc_clone(&p_sys->thread, Thread, p_intf, VLC_THREAD_PRIORITY_LOW))
	{
		vlc_mutex_destroy(&p_sys->lock);
		free(p_sys);
		p_intf->p_sys = NULL;
		return VLC_ENOMEM;
	}

	var_AddCallback(pl_Get(p_intf->p_libvlc), "input-current", PlaylistEvent, p_intf);

	return VLC_SUCCESS;
}
开发者ID:poiru,项目名称:vlc-libcad,代码行数:34,代码来源:cad.c


示例5: Close

/*****************************************************************************
 * Close: destroy interface stuff
 *****************************************************************************/
static void Close( vlc_object_t *p_this )
{
    intf_thread_t *p_intf = (intf_thread_t *)p_this;
    playlist_t *p_playlist = pl_Get( p_this );
    input_thread_t *p_input = NULL;

    var_DelCallback( p_playlist, "item-change", ItemChange, p_intf );
    var_DelCallback( p_playlist, "item-current", ItemChange, p_intf );
    if( (p_input = playlist_CurrentInput( p_playlist )) )
    {
        var_DelCallback( p_input, "state", StateChange, p_intf );
        vlc_object_release( p_input );
    }

    /* Clears the Presence message ... else it looks like we're still playing
     * something although VLC (or the Telepathy plugin) is closed */

    /* Do not check for VLC_ENOMEM as we're closing */
    SendToTelepathy( p_intf, "" );

    /* we won't use the DBus connection anymore */
    dbus_connection_unref( p_intf->p_sys->p_conn );

    /* Destroy structure */
    free( p_intf->p_sys->psz_format );
    free( p_intf->p_sys );
}
开发者ID:Italianmoose,项目名称:Stereoscopic-VLC,代码行数:30,代码来源:telepathy.c


示例6: Close

/*****************************************************************************
 * Close:
 *****************************************************************************/
static void Close( vlc_object_t *p_this )
{
    services_discovery_t *p_sd = ( services_discovery_t* )p_this;
    services_discovery_sys_t *p_sys  = p_sd->p_sys;
    playlist_t *pl = pl_Get( p_this );
    int i;

    vlc_cancel (p_sys->thread);
    vlc_join (p_sys->thread, NULL);

    var_DelCallback( pl, "podcast-urls", UrlsChange, p_sys );
    var_DelCallback( pl, "podcast-request", Request, p_sys );
    vlc_cond_destroy( &p_sys->wait );
    vlc_mutex_destroy( &p_sys->lock );

    for( i = 0; i < p_sys->i_input; i++ )
    {
        input_thread_t *p_input = p_sd->p_sys->pp_input[i];
        if( !p_input )
            continue;

        input_Stop( p_input, true );
        input_Close( p_input );

        p_sd->p_sys->pp_input[i] = NULL;
    }
    free( p_sd->p_sys->pp_input );
    for( i = 0; i < p_sys->i_urls; i++ ) free( p_sys->ppsz_urls[i] );
    free( p_sys->ppsz_urls );
    for( i = 0; i < p_sys->i_items; i++ ) vlc_gc_decref( p_sys->pp_items[i] );
    free( p_sys->pp_items );
    free( p_sys->psz_request );
    free( p_sys );
}
开发者ID:andronmobi,项目名称:vlc-parrot-asteroid,代码行数:37,代码来源:podcast.c


示例7: ServiceDispatch

static void WINAPI ServiceDispatch( DWORD numArgs, char **args )
{
    (void)numArgs;
    (void)args;
    intf_thread_t *p_intf = (intf_thread_t *)p_global_intf;
    intf_sys_t    *p_sys  = p_intf->p_sys;
    char *psz_modules, *psz_parser;

    /* We have to initialize the service-specific stuff */
    memset( &p_sys->status, 0, sizeof(SERVICE_STATUS) );
    p_sys->status.dwServiceType = SERVICE_WIN32;
    p_sys->status.dwCurrentState = SERVICE_START_PENDING;
    p_sys->status.dwControlsAccepted = SERVICE_ACCEPT_STOP;

    p_sys->hStatus =
        RegisterServiceCtrlHandlerA( p_sys->psz_service, &ServiceCtrlHandler );
    if( p_sys->hStatus == (SERVICE_STATUS_HANDLE)0 )
    {
        msg_Err( p_intf, "failed to register service control handler" );
        return;
    }

    /*
     * Load background interfaces
     */
    psz_modules = var_InheritString( p_intf, "ntservice-extraintf" );
    psz_parser = psz_modules;
    while( psz_parser && *psz_parser )
    {
        char *psz_module, *psz_temp;
        psz_module = psz_parser;
        psz_parser = strchr( psz_module, ',' );
        if( psz_parser )
        {
            *psz_parser = '\0';
            psz_parser++;
        }

        if( asprintf( &psz_temp, "%s,none", psz_module ) != -1 )
        {
            /* Try to create the interface */
            if( intf_Create( pl_Get(p_intf), psz_temp ) )
            {
                msg_Err( p_intf, "interface \"%s\" initialization failed",
                         psz_temp );
                free( psz_temp );
                continue;
            }
            free( psz_temp );
        }
    }
    free( psz_modules );

    /* Initialization complete - report running status */
    p_sys->status.dwCurrentState = SERVICE_RUNNING;
    p_sys->status.dwCheckPoint   = 0;
    p_sys->status.dwWaitHint     = 0;

    SetServiceStatus( p_sys->hStatus, &p_sys->status );
}
开发者ID:qdk0901,项目名称:vlc,代码行数:60,代码来源:ntservice.c


示例8: MarshalMetadata

static int
MarshalMetadata( intf_thread_t *p_intf, DBusMessageIter *container )
{
    playlist_t *playlist = pl_Get( p_intf );
    playlist_item_t *item;
    int result = VLC_SUCCESS;

    playlist_Lock( playlist );
    item = playlist_CurrentPlayingItem( playlist );

    if( item != NULL )
        result = GetInputMeta( item, container );
    else
    {   // avoid breaking the type marshalling
        DBusMessageIter a;

        if( !dbus_message_iter_open_container( container, DBUS_TYPE_ARRAY,
                                               "{sv}", &a ) ||
            !dbus_message_iter_close_container( container, &a ) )
            result = VLC_ENOMEM;
    }

    playlist_Unlock( playlist );
    return result;
}
开发者ID:chouquette,项目名称:vlc,代码行数:25,代码来源:dbus_player.c


示例9: GetFilenames

/*****************************************************************************
 * GetFilenames: parse command line options which are not flags
 *****************************************************************************
 * Parse command line for input files as well as their associated options.
 * An option always follows its associated input and begins with a ":".
 *****************************************************************************/
static void GetFilenames( libvlc_int_t *p_vlc, unsigned n,
                          const char *const args[] )
{
    while( n > 0 )
    {
        /* Count the input options */
        unsigned i_options = 0;

        while( args[--n][0] == ':' )
        {
            i_options++;
            if( n == 0 )
            {
                msg_Warn( p_vlc, "options %s without item", args[n] );
                return; /* syntax!? */
            }
        }

        char *mrl = NULL;
        if( strstr( args[n], "://" ) == NULL )
        {
            mrl = vlc_path2uri( args[n], NULL );
            if( !mrl )
                continue;
        }

        playlist_AddExt( pl_Get( p_vlc ), (mrl != NULL) ? mrl : args[n], NULL,
                         PLAYLIST_INSERT, 0, -1, i_options,
                         ( i_options ? &args[n + 1] : NULL ),
                         VLC_INPUT_OPTION_TRUSTED, true, pl_Unlocked );
        free( mrl );
    }
}
开发者ID:RodrigoNieves,项目名称:vlc,代码行数:39,代码来源:libvlc.c


示例10: Activate

/*****************************************************************************
 * Activate: initialize and create stuff
 *****************************************************************************/
static int Activate( vlc_object_t *p_this )
{
    intf_thread_t *p_intf = (intf_thread_t*)p_this;
    intf_sys_t *p_sys;
    DBusError     error;

    p_sys = p_intf->p_sys = (intf_sys_t *) calloc( 1, sizeof( intf_sys_t ) );
    if( !p_sys )
        return VLC_ENOMEM;

    p_sys->i_cookie[FREEDESKTOP] = 0;
    p_sys->i_cookie[GNOME] = 0;
    p_sys->p_input = NULL;

    dbus_error_init( &error );

    /* connect privately to the session bus
     * the connection will not be shared with other vlc modules which use dbus,
     * thus avoiding a whole class of concurrency issues */
    p_sys->p_conn = dbus_bus_get_private( DBUS_BUS_SESSION, &error );
    if( !p_sys->p_conn )
    {
        msg_Err( p_this, "Failed to connect to the D-Bus session daemon: %s",
                error.message );
        dbus_error_free( &error );
        free( p_sys );
        return VLC_EGENERIC;
    }

    p_sys->p_playlist = pl_Get( p_intf );
    var_AddCallback( p_sys->p_playlist, "item-current", InputChange, p_intf );
    return VLC_SUCCESS;
}
开发者ID:vlcchina,项目名称:vlc-player-experimental,代码行数:36,代码来源:inhibit.c


示例11: Close

/*****************************************************************************
 * Close: destroy interface stuff
 *****************************************************************************/
static void Close(vlc_object_t *p_this)
{
    intf_thread_t               *p_intf = (intf_thread_t*) p_this;
    intf_sys_t                  *p_sys  = p_intf->p_sys;

    var_DelCallback(pl_Get(p_intf), "activity", ItemChange, p_intf);

    vlc_cancel(p_sys->thread);
    vlc_join(p_sys->thread, NULL);

    input_thread_t *p_input = pl_CurrentInput(p_intf);
    if (p_input)
    {
        if (p_sys->b_state_cb)
            var_DelCallback(p_input, "intf-event", PlayingChange, p_intf);
        vlc_object_release(p_input);
    }

    int i;
    for (i = 0; i < p_sys->i_songs; i++)
        DeleteSong(&p_sys->p_queue[i]);
    vlc_UrlClean(&p_sys->p_submit_url);
#if 0 //NOT USED
    free(p_sys->psz_nowp_host);
    free(p_sys->psz_nowp_file);
#endif
    vlc_cond_destroy(&p_sys->wait);
    vlc_mutex_destroy(&p_sys->lock);
    free(p_sys);
}
开发者ID:Kubink,项目名称:vlc,代码行数:33,代码来源:audioscrobbler.c


示例12: Close

/*****************************************************************************
 * Close: destroy interface stuff
 *****************************************************************************/
static void Close( vlc_object_t *p_this )
{
    playlist_t                  *p_playlist = pl_Get( p_this );
    input_thread_t              *p_input;
    intf_thread_t               *p_intf = ( intf_thread_t* ) p_this;
    intf_sys_t                  *p_sys  = p_intf->p_sys;

    var_DelCallback( p_playlist, "item-current", ItemChange, p_intf );

    p_input = playlist_CurrentInput( p_playlist );
    if ( p_input )
    {
        if( p_sys->b_state_cb )
            var_DelCallback( p_input, "intf-event", PlayingChange, p_intf );
        vlc_object_release( p_input );
    }

    int i;
    for( i = 0; i < p_sys->i_songs; i++ )
        DeleteSong( &p_sys->p_queue[i] );
    free( p_sys->psz_submit_host );
    free( p_sys->psz_submit_file );
#if 0 //NOT USED
    free( p_sys->psz_nowp_host );
    free( p_sys->psz_nowp_file );
#endif
    vlc_cond_destroy( &p_sys->wait );
    vlc_mutex_destroy( &p_sys->lock );
    free( p_sys );
}
开发者ID:Italianmoose,项目名称:Stereoscopic-VLC,代码行数:33,代码来源:audioscrobbler.c


示例13: input_GetItem

void InputManager::requestArtUpdate( input_item_t *p_item )
{
    bool b_current_item = false;
    if ( !p_item && hasInput() )
    {   /* default to current item */
        p_item = input_GetItem( p_input );
        b_current_item = true;
    }

    if ( p_item )
    {
        /* check if it has already been enqueued */
        if ( p_item->p_meta )
        {
            int status = vlc_meta_GetStatus( p_item->p_meta );
            if ( status & ( ITEM_ART_NOTFOUND|ITEM_ART_FETCHED ) )
                return;
        }
        playlist_AskForArtEnqueue( pl_Get(p_intf), p_item );
        /* No input will signal the cover art to update,
             * let's do it ourself */
        if ( b_current_item )
            UpdateArt();
        else
            emit artChanged( p_item );
    }
}
开发者ID:RodrigoNieves,项目名称:vlc,代码行数:27,代码来源:input_manager.cpp


示例14: Close

/*****************************************************************************
 * Close: destroy interface stuff
 *****************************************************************************/
static void Close(vlc_object_t *p_this)
{
    intf_thread_t               *p_intf = (intf_thread_t*) p_this;
    intf_sys_t                  *p_sys  = p_intf->p_sys;

    vlc_cancel(p_sys->thread);
    vlc_join(p_sys->thread, NULL);

    var_DelCallback(pl_Get(p_intf), "input-current", ItemChange, p_intf);

    if (p_sys->p_input != NULL)
    {
        var_DelCallback(p_sys->p_input, "intf-event", PlayingChange, p_intf);
        vlc_object_release(p_sys->p_input);
    }

    int i;
    for (i = 0; i < p_sys->i_songs; i++)
        DeleteSong(&p_sys->p_queue[i]);
    vlc_UrlClean(&p_sys->p_submit_url);
    vlc_UrlClean(&p_sys->p_nowp_url);
    vlc_cond_destroy(&p_sys->wait);
    vlc_mutex_destroy(&p_sys->lock);
    free(p_sys);
}
开发者ID:0xheart0,项目名称:vlc,代码行数:28,代码来源:audioscrobbler.c


示例15: Open

/*****************************************************************************
 * OpenIntf: initialize interface
 *****************************************************************************/
static int Open ( vlc_object_t *p_this )
{
    intf_thread_t *p_intf = (intf_thread_t *)p_this;

    /* Allocate instance and initialize some members */
    intf_sys_t *p_sys = p_intf->p_sys = (intf_sys_t *)malloc( sizeof( intf_sys_t ) );			// sunqueen modify
    if( unlikely(p_sys == NULL) )
        return VLC_ENOMEM;

    // Configure the module
    vlc_mutex_init( &p_sys->lock );
    p_sys->p_input = NULL;
    p_sys->p_vout = NULL;
    p_sys->b_button_pressed = false;
    p_sys->i_threshold = var_InheritInteger( p_intf, "gestures-threshold" );

    // Choose the tight button to use
    char *psz_button = var_InheritString( p_intf, "gestures-button" );
    if( psz_button && !strcmp( psz_button, "left" ) )
        p_sys->i_button_mask = 1;
    else if( psz_button && !strcmp( psz_button, "middle" ) )
        p_sys->i_button_mask = 2;
    else // psz_button == "right"
        p_sys->i_button_mask = 4;
    free( psz_button );

    p_sys->i_pattern = 0;
    p_sys->i_num_gestures = 0;

    var_AddCallback( pl_Get(p_intf), "input-current", PlaylistEvent, p_intf );

    return VLC_SUCCESS;
}
开发者ID:12307,项目名称:VLC-for-VS2010,代码行数:36,代码来源:gestures.c


示例16: Close

/*****************************************************************************
 * CloseIntf: destroy dummy interface
 *****************************************************************************/
static void Close ( vlc_object_t *p_this )
{
    intf_thread_t *p_intf = (intf_thread_t *)p_this;
    intf_sys_t *p_sys = p_intf->p_sys;

    /* Destroy the callbacks (the order matters!) */
    var_DelCallback( pl_Get(p_intf), "input-current", PlaylistEvent, p_intf );

    if( p_sys->p_input )
    {
        var_DelCallback( p_sys->p_input, "intf-event", InputEvent, p_intf );
        vlc_object_release( p_sys->p_input );
    }

    if( p_sys->p_vout )
    {
        var_DelCallback( p_sys->p_vout, "mouse-moved", MovedEvent, p_intf );
        var_DelCallback( p_sys->p_vout, "mouse-button-down",
                         ButtonEvent, p_intf );
        vlc_object_release( p_sys->p_vout );
    }

    /* Destroy structure */
    vlc_mutex_destroy( &p_sys->lock );
    free( p_sys );
}
开发者ID:12307,项目名称:VLC-for-VS2010,代码行数:29,代码来源:gestures.c


示例17: input_item_SetTitle

/**
 * Save the MetaData, triggered by parent->save Button
 **/
void MetaPanel::saveMeta()
{
    if( p_input == NULL )
        return;

    /* now we read the modified meta data */
    input_item_SetTitle(  p_input, qtu( title_text->text() ) );
    input_item_SetArtist( p_input, qtu( artist_text->text() ) );
    input_item_SetAlbum(  p_input, qtu( collection_text->text() ) );
    input_item_SetGenre(  p_input, qtu( genre_text->text() ) );
    input_item_SetTrackNum(  p_input, qtu( seqnum_text->text() ) );
    input_item_SetTrackTotal(  p_input, qtu( seqtot_text->text() ) );
    input_item_SetDate(  p_input, qtu( date_text->text() ) );
    input_item_SetLanguage(  p_input, qtu( language_text->text() ) );

    input_item_SetCopyright( p_input, qtu( copyright_text->text() ) );
    input_item_SetPublisher( p_input, qtu( publisher_text->text() ) );
    input_item_SetDescription( p_input, qtu( description_text->toPlainText() ) );

    playlist_t *p_playlist = pl_Get( p_intf );
    input_item_WriteMeta( VLC_OBJECT(p_playlist), p_input );

    /* Reset the status of the mode. No need to emit any signal because parent
       is the only caller */
    b_inEditMode = false;
}
开发者ID:12307,项目名称:VLC-for-VS2010,代码行数:29,代码来源:info_panels.cpp


示例18: Prev

/* libnotify callback, called when the "Previous" button is pressed */
static void Prev( NotifyNotification *notification, gchar *psz, gpointer p )
{
    vlc_object_t *p_object = (vlc_object_t*)p;

    VLC_UNUSED(psz);
    notify_notification_close( notification, NULL );
    playlist_Prev( pl_Get( p_object ) );
}
开发者ID:cmassiot,项目名称:vlc-broadcast,代码行数:9,代码来源:notify.c


示例19: Next

/* libnotify callback, called when the "Next" button is pressed */
static void Next( NotifyNotification *notification, gchar *psz, gpointer p )
{
    intf_thread_t *p_object = (intf_thread_t *)p;

    VLC_UNUSED(psz);
    notify_notification_close( notification, NULL );
    playlist_Next( pl_Get( p_object ) );
}
开发者ID:mstorsjo,项目名称:vlc,代码行数:9,代码来源:notify.c


示例20: ReadMetaData

/* ****************************************************************************/
static void ReadMetaData(intf_thread_t *p_this)
{
    input_thread_t      *p_input;
    input_item_t        *p_item;

    intf_sys_t          *p_sys = p_this->p_sys;

    p_input = playlist_CurrentInput(pl_Get(p_this));

    if (!p_input)
        return;

    p_item = input_GetItem(p_input);
    if (!p_item)
    {
        vlc_object_release(p_input);
        return;
    }

#define ALLOC_ITEM_META(a, b) do { \
         char *psz_meta = input_item_Get##b(p_item); \
         if (psz_meta && *psz_meta) \
             a = encode_URI_component(psz_meta); \
         free(psz_meta); \
     } while (0)

    vlc_mutex_lock(&p_sys->lock);

    p_sys->b_meta_read = true;

    ALLOC_ITEM_META(p_sys->p_current_item.psz_n, Name);
    if (!p_sys->p_current_item.psz_n)
    {
        msg_Dbg(p_this, "No name..");
        DeleteItem(&p_sys->p_current_item);
        goto end;
    }

    ALLOC_ITEM_META(p_sys->p_current_item.psz_u, URI);
    if (!p_sys->p_current_item.psz_u)
    {
        msg_Dbg(p_this, "No URI..");
        DeleteItem(&p_sys->p_current_item);
        goto end;
    }

    /* Now we have read the mandatory meta data, so we can submit that info */
    p_sys->b_submit = true;

    /* Duration in seconds */
    p_sys->p_current_item.i_l = input_item_GetDuration(p_item) / 1000000;

#undef ALLOC_ITEM_META

end:
    vlc_mutex_unlock(&p_sys->lock);
    vlc_object_release(p_input);
}
开发者ID:watchedit,项目名称:vlc-module,代码行数:59,代码来源:scrobbler.c



注:本文中的pl_Get函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ plabort函数代码示例发布时间:2022-05-30
下一篇:
C++ pl函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap