Commit 763cea5e authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Replace vlc_gc_incref() with input_item_Hold()

parent 3546f6b0
...@@ -51,7 +51,7 @@ static inline fingerprint_request_t *fingerprint_request_New( input_item_t *p_it ...@@ -51,7 +51,7 @@ static inline fingerprint_request_t *fingerprint_request_New( input_item_t *p_it
if ( !p_r ) return NULL; if ( !p_r ) return NULL;
p_r->results.psz_fingerprint = NULL; p_r->results.psz_fingerprint = NULL;
p_r->i_duration = 0; p_r->i_duration = 0;
vlc_gc_incref( p_item ); input_item_Hold( p_item );
p_r->p_item = p_item; p_r->p_item = p_item;
vlc_array_init( & p_r->results.metas_array ); /* shouldn't be needed */ vlc_array_init( & p_r->results.metas_array ); /* shouldn't be needed */
return p_r; return p_r;
......
...@@ -367,7 +367,6 @@ VLC_API input_item_t *input_item_Hold(input_item_t *); ...@@ -367,7 +367,6 @@ VLC_API input_item_t *input_item_Hold(input_item_t *);
VLC_API void input_item_Release(input_item_t *); VLC_API void input_item_Release(input_item_t *);
/* Historical hack... */ /* Historical hack... */
#define vlc_gc_incref(i) input_item_Hold(i)
#define vlc_gc_decref(i) input_item_Release(i) #define vlc_gc_decref(i) input_item_Release(i)
typedef enum input_item_meta_request_option_t typedef enum input_item_meta_request_option_t
......
...@@ -403,7 +403,7 @@ libvlc_media_t * libvlc_media_new_from_input_item( ...@@ -403,7 +403,7 @@ libvlc_media_t * libvlc_media_new_from_input_item(
return NULL; return NULL;
} }
vlc_gc_incref( p_md->p_input_item ); input_item_Hold( p_md->p_input_item );
install_input_item_observer( p_md ); install_input_item_observer( p_md );
......
...@@ -67,7 +67,7 @@ static void entry_item_append( services_discovery_t *p_sd, ...@@ -67,7 +67,7 @@ static void entry_item_append( services_discovery_t *p_sd,
return; return;
p_entry_item->p_entry = p_entry; p_entry_item->p_entry = p_entry;
p_entry_item->p_item = p_item; p_entry_item->p_item = p_item;
vlc_gc_incref( p_item ); input_item_Hold( p_item );
vlc_array_append( &p_sys->entry_item_list, p_entry_item ); vlc_array_append( &p_sys->entry_item_list, p_entry_item );
services_discovery_AddItem( p_sd, p_item, NULL ); services_discovery_AddItem( p_sd, p_item, NULL );
} }
......
...@@ -203,7 +203,7 @@ int Control(demux_t *demux, int query, va_list args) ...@@ -203,7 +203,7 @@ int Control(demux_t *demux, int query, va_list args)
input_item_t * GetCurrentItem(demux_t *p_demux) input_item_t * GetCurrentItem(demux_t *p_demux)
{ {
input_item_t *p_current_input = input_GetItem( p_demux->p_input ); input_item_t *p_current_input = input_GetItem( p_demux->p_input );
vlc_gc_incref(p_current_input); input_item_Hold(p_current_input);
return p_current_input; return p_current_input;
} }
......
...@@ -181,7 +181,7 @@ ...@@ -181,7 +181,7 @@
vlc_gc_decref(p_item); vlc_gc_decref(p_item);
[_saveMetaDataButton setEnabled: NO]; [_saveMetaDataButton setEnabled: NO];
if (_p_item) if (_p_item)
vlc_gc_incref(_p_item); input_item_Hold(_p_item);
p_item = _p_item; p_item = _p_item;
} }
......
...@@ -761,7 +761,7 @@ CoverArtLabel::CoverArtLabel( QWidget *parent, intf_thread_t *_p_i ) ...@@ -761,7 +761,7 @@ CoverArtLabel::CoverArtLabel( QWidget *parent, intf_thread_t *_p_i )
p_item = THEMIM->currentInputItem(); p_item = THEMIM->currentInputItem();
if( p_item ) if( p_item )
{ {
vlc_gc_incref( p_item ); input_item_Hold( p_item );
showArtUpdate( p_item ); showArtUpdate( p_item );
} }
else else
...@@ -780,7 +780,7 @@ void CoverArtLabel::setItem( input_item_t *_p_item ) ...@@ -780,7 +780,7 @@ void CoverArtLabel::setItem( input_item_t *_p_item )
{ {
if ( p_item ) vlc_gc_decref( p_item ); if ( p_item ) vlc_gc_decref( p_item );
p_item = _p_item; p_item = _p_item;
if ( p_item ) vlc_gc_incref( p_item ); if ( p_item ) input_item_Hold( p_item );
} }
void CoverArtLabel::showArtUpdate( const QString& url ) void CoverArtLabel::showArtUpdate( const QString& url )
......
...@@ -61,7 +61,7 @@ void PLItem::init( playlist_item_t *_playlist_item, PLItem *parent ) ...@@ -61,7 +61,7 @@ void PLItem::init( playlist_item_t *_playlist_item, PLItem *parent )
i_playlist_id = _playlist_item->i_id; /* Playlist item specific id */ i_playlist_id = _playlist_item->i_id; /* Playlist item specific id */
p_input = _playlist_item->p_input; p_input = _playlist_item->p_input;
i_flags = _playlist_item->i_flags; i_flags = _playlist_item->i_flags;
vlc_gc_incref( p_input ); input_item_Hold( p_input );
} }
/* /*
......
...@@ -1089,7 +1089,7 @@ PlMimeData::~PlMimeData() ...@@ -1089,7 +1089,7 @@ PlMimeData::~PlMimeData()
void PlMimeData::appendItem( input_item_t *p_item ) void PlMimeData::appendItem( input_item_t *p_item )
{ {
vlc_gc_incref( p_item ); input_item_Hold( p_item );
_inputItems.append( p_item ); _inputItems.append( p_item );
} }
......
...@@ -438,7 +438,7 @@ PLSelItem * PLSelector::addItem ( ...@@ -438,7 +438,7 @@ PLSelItem * PLSelector::addItem (
PLSelItem *PLSelector::addPodcastItem( playlist_item_t *p_item ) PLSelItem *PLSelector::addPodcastItem( playlist_item_t *p_item )
{ {
vlc_gc_incref( p_item->p_input ); input_item_Hold( p_item->p_input );
char *psz_name = input_item_GetName( p_item->p_input ); char *psz_name = input_item_GetName( p_item->p_input );
PLSelItem *item = addItem( PL_ITEM_TYPE, psz_name, false, false, podcastsParent ); PLSelItem *item = addItem( PL_ITEM_TYPE, psz_name, false, false, podcastsParent );
......
...@@ -172,7 +172,7 @@ void EpgDialog::updateInfos() ...@@ -172,7 +172,7 @@ void EpgDialog::updateInfos()
{ {
PL_LOCK; /* as input_GetItem still unfixed */ PL_LOCK; /* as input_GetItem still unfixed */
p_input_item = input_GetItem( p_input_thread ); p_input_item = input_GetItem( p_input_thread );
if ( p_input_item ) vlc_gc_incref( p_input_item ); if ( p_input_item ) input_item_Hold( p_input_item );
PL_UNLOCK; PL_UNLOCK;
vlc_object_release( p_input_thread ); vlc_object_release( p_input_thread );
if ( p_input_item ) if ( p_input_item )
......
...@@ -81,7 +81,7 @@ public: ...@@ -81,7 +81,7 @@ public:
: QEvent( (QEvent::Type)(type) ) : QEvent( (QEvent::Type)(type) )
{ {
if( (p_item = p_input) != NULL ) if( (p_item = p_input) != NULL )
vlc_gc_incref( p_item ); input_item_Hold( p_item );
} }
virtual ~IMEvent() virtual ~IMEvent()
......
...@@ -47,7 +47,7 @@ public: ...@@ -47,7 +47,7 @@ public:
CmdGeneric( pIntf ), m_pItem( pItem ) CmdGeneric( pIntf ), m_pItem( pItem )
{ {
if( pItem ) if( pItem )
vlc_gc_incref( pItem ); input_item_Hold( pItem );
} }
virtual ~CmdItemUpdate() virtual ~CmdItemUpdate()
{ {
......
...@@ -609,7 +609,7 @@ static int Control( extensions_manager_t *p_mgr, int i_control, va_list args ) ...@@ -609,7 +609,7 @@ static int Control( extensions_manager_t *p_mgr, int i_control, va_list args )
p_ext->p_sys->i_capabilities & EXT_META_LISTENER ) p_ext->p_sys->i_capabilities & EXT_META_LISTENER )
{ {
p_item = input_GetItem( p_ext->p_sys->p_input ); p_item = input_GetItem( p_ext->p_sys->p_input );
vlc_gc_incref( p_item ); input_item_Hold( p_item );
vlc_event_attach( &p_item->event_manager, vlc_event_attach( &p_item->event_manager,
vlc_InputItemMetaChanged, vlc_InputItemMetaChanged,
inputItemMetaChanged, inputItemMetaChanged,
......
...@@ -413,7 +413,7 @@ static const luaL_Reg vlclua_input_item_reg[] = { ...@@ -413,7 +413,7 @@ static const luaL_Reg vlclua_input_item_reg[] = {
static int vlclua_input_item_get( lua_State *L, input_item_t *p_item ) static int vlclua_input_item_get( lua_State *L, input_item_t *p_item )
{ {
vlc_gc_incref( p_item ); input_item_Hold( p_item );
input_item_t **pp = lua_newuserdata( L, sizeof( input_item_t* ) ); input_item_t **pp = lua_newuserdata( L, sizeof( input_item_t* ) );
*pp = p_item; *pp = p_item;
......
...@@ -327,7 +327,7 @@ static input_thread_t *Create( vlc_object_t *p_parent, input_item_t *p_item, ...@@ -327,7 +327,7 @@ static input_thread_t *Create( vlc_object_t *p_parent, input_item_t *p_item,
else else
vlc_viewpoint_init( &priv->viewpoint ); vlc_viewpoint_init( &priv->viewpoint );
vlc_gc_incref( p_item ); /* Released in Destructor() */ input_item_Hold( p_item ); /* Released in Destructor() */
priv->p_item = p_item; priv->p_item = p_item;
/* Init Input fields */ /* Init Input fields */
......
...@@ -1259,7 +1259,7 @@ input_item_node_t *input_item_node_Create( input_item_t *p_input ) ...@@ -1259,7 +1259,7 @@ input_item_node_t *input_item_node_Create( input_item_t *p_input )
assert( p_input ); assert( p_input );
p_node->p_item = p_input; p_node->p_item = p_input;
vlc_gc_incref( p_input ); input_item_Hold( p_input );
p_node->p_parent = NULL; p_node->p_parent = NULL;
p_node->i_children = 0; p_node->i_children = 0;
......
...@@ -287,7 +287,7 @@ playlist_item_t *playlist_ItemNewFromInput( playlist_t *p_playlist, ...@@ -287,7 +287,7 @@ playlist_item_t *playlist_ItemNewFromInput( playlist_t *p_playlist,
assert( p_item == *pp ); assert( p_item == *pp );
p->i_last_playlist_id = p_item->i_id; p->i_last_playlist_id = p_item->i_id;
vlc_gc_incref( p_item->p_input ); input_item_Hold( p_item->p_input );
vlc_event_manager_t *p_em = &p_item->p_input->event_manager; vlc_event_manager_t *p_em = &p_item->p_input->event_manager;
......
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