[vlc-commits] Replace vlc_gc_decref() with input_item_Release()
Rémi Denis-Courmont
git at videolan.org
Sun Apr 9 16:29:08 CEST 2017
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Apr 9 17:26:19 2017 +0300| [f4bb458815b0b52afdb2b6a932b2cecdc802b2c4] | committer: Rémi Denis-Courmont
Replace vlc_gc_decref() with input_item_Release()
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f4bb458815b0b52afdb2b6a932b2cecdc802b2c4
---
include/vlc_fingerprinter.h | 2 +-
include/vlc_input_item.h | 3 ---
lib/media.c | 4 +--
lib/media_list.c | 2 +-
modules/access/dsm/sd.c | 6 ++---
modules/control/oldrc.c | 2 +-
modules/demux/mp4/mp4.c | 2 +-
modules/demux/playlist/asx.c | 4 +--
modules/demux/playlist/b4s.c | 4 +--
modules/demux/playlist/dvb.c | 6 ++---
modules/demux/playlist/gvp.c | 4 +--
modules/demux/playlist/ifo.c | 8 +++---
modules/demux/playlist/itml.c | 4 +--
modules/demux/playlist/m3u.c | 4 +--
modules/demux/playlist/pls.c | 6 ++---
modules/demux/playlist/podcast.c | 6 ++---
modules/demux/playlist/qtl.c | 6 ++---
modules/demux/playlist/ram.c | 4 +--
modules/demux/playlist/sgimb.c | 4 +--
modules/demux/playlist/shoutcast.c | 6 ++---
modules/demux/playlist/xspf.c | 29 +++++++++++-----------
.../gui/macosx/VLCConvertAndSaveWindowController.m | 2 +-
modules/gui/macosx/VLCPlaylistInfo.m | 4 +--
modules/gui/qt/components/interface_widgets.cpp | 4 +--
.../gui/qt/components/playlist/playlist_item.cpp | 2 +-
.../gui/qt/components/playlist/playlist_model.cpp | 2 +-
modules/gui/qt/components/playlist/selector.cpp | 4 +--
modules/gui/qt/dialogs/epg.cpp | 2 +-
modules/gui/qt/input_manager.hpp | 2 +-
modules/gui/skins2/commands/cmd_vars.hpp | 2 +-
modules/lua/extension.c | 4 +--
modules/lua/libs/input.c | 2 +-
modules/lua/libs/sd.c | 4 +--
modules/lua/vlc.c | 2 +-
modules/services_discovery/avahi.c | 2 +-
modules/services_discovery/mediadirs.c | 4 +--
modules/services_discovery/mtp.c | 2 +-
modules/services_discovery/podcast.c | 7 +++---
modules/services_discovery/pulse.c | 8 +++---
modules/services_discovery/sap.c | 2 +-
modules/services_discovery/udev.c | 4 +--
modules/services_discovery/upnp.cpp | 2 +-
modules/services_discovery/xcb_apps.c | 4 +--
src/input/input.c | 2 +-
src/input/item.c | 2 +-
src/input/vlm.c | 6 ++---
src/playlist/item.c | 6 ++---
src/playlist/loadsave.c | 2 +-
src/playlist/tree.c | 2 +-
49 files changed, 103 insertions(+), 104 deletions(-)
diff --git a/include/vlc_fingerprinter.h b/include/vlc_fingerprinter.h
index e7986f5541..01bbcabc11 100644
--- a/include/vlc_fingerprinter.h
+++ b/include/vlc_fingerprinter.h
@@ -59,7 +59,7 @@ static inline fingerprint_request_t *fingerprint_request_New( input_item_t *p_it
static inline void fingerprint_request_Delete( fingerprint_request_t *p_f )
{
- vlc_gc_decref( p_f->p_item );
+ input_item_Release( p_f->p_item );
free( p_f->results.psz_fingerprint );
for( size_t i = 0; i < vlc_array_count( & p_f->results.metas_array ); i++ )
vlc_meta_Delete( (vlc_meta_t *) vlc_array_item_at_index( & p_f->results.metas_array, i ) );
diff --git a/include/vlc_input_item.h b/include/vlc_input_item.h
index 950d25fec2..461bab9b1d 100644
--- a/include/vlc_input_item.h
+++ b/include/vlc_input_item.h
@@ -366,9 +366,6 @@ VLC_API input_item_t *input_item_Hold(input_item_t *);
/** Releases an input item, i.e. decrements its reference counter. */
VLC_API void input_item_Release(input_item_t *);
-/* Historical hack... */
-#define vlc_gc_decref(i) input_item_Release(i)
-
typedef enum input_item_meta_request_option_t
{
META_REQUEST_OPTION_NONE = 0x00,
diff --git a/lib/media.c b/lib/media.c
index 49a2bea22d..4c95c94c8e 100644
--- a/lib/media.c
+++ b/lib/media.c
@@ -431,7 +431,7 @@ libvlc_media_t *libvlc_media_new_location( libvlc_instance_t *p_instance,
p_md = libvlc_media_new_from_input_item( p_instance, p_input_item );
/* The p_input_item is retained in libvlc_media_new_from_input_item */
- vlc_gc_decref( p_input_item );
+ input_item_Release( p_input_item );
return p_md;
}
@@ -555,7 +555,7 @@ void libvlc_media_release( libvlc_media_t *p_md )
if( p_md->p_subitems )
libvlc_media_list_release( p_md->p_subitems );
- vlc_gc_decref( p_md->p_input_item );
+ input_item_Release( p_md->p_input_item );
vlc_cond_destroy( &p_md->parsed_cond );
vlc_mutex_destroy( &p_md->parsed_lock );
diff --git a/lib/media_list.c b/lib/media_list.c
index 53c1b6c203..5274969f70 100644
--- a/lib/media_list.c
+++ b/lib/media_list.c
@@ -253,7 +253,7 @@ libvlc_media_list_add_file_content( libvlc_media_list_t * p_mlist,
p_input_item );
if( !p_md )
{
- vlc_gc_decref( p_input_item );
+ input_item_Release( p_input_item );
return -1;
}
diff --git a/modules/access/dsm/sd.c b/modules/access/dsm/sd.c
index 871cd68310..b6252fd8dd 100644
--- a/modules/access/dsm/sd.c
+++ b/modules/access/dsm/sd.c
@@ -85,7 +85,7 @@ static void entry_item_remove( services_discovery_t *p_sd,
if( p_entry_item->p_entry == p_entry )
{
services_discovery_RemoveItem( p_sd, p_entry_item->p_item );
- vlc_gc_decref( p_entry_item->p_item );
+ input_item_Release( p_entry_item->p_item );
vlc_array_remove( &p_sys->entry_item_list, i );
free( p_entry_item );
break;
@@ -114,7 +114,7 @@ static void netbios_ns_discover_on_entry_added( void *p_opaque,
free(psz_mrl);
entry_item_append( p_sd, p_entry, p_item );
- vlc_gc_decref( p_item );
+ input_item_Release( p_item );
}
}
@@ -177,7 +177,7 @@ void bdsm_SdClose (vlc_object_t *p_this)
struct entry_item *p_entry_item;
p_entry_item = vlc_array_item_at_index( &p_sys->entry_item_list, i );
- vlc_gc_decref( p_entry_item->p_item );
+ input_item_Release( p_entry_item->p_item );
free( p_entry_item );
}
vlc_array_clear( &p_sys->entry_item_list );
diff --git a/modules/control/oldrc.c b/modules/control/oldrc.c
index 02852c5ce5..d33a74c62c 100644
--- a/modules/control/oldrc.c
+++ b/modules/control/oldrc.c
@@ -1298,7 +1298,7 @@ static int Playlist( vlc_object_t *p_this, char const *psz_cmd,
msg_rc( "Trying to add %s to playlist.", newval.psz_string );
int i_ret = playlist_AddInput( p_playlist, p_item,
PLAYLIST_GO, true );
- vlc_gc_decref( p_item );
+ input_item_Release( p_item );
if( i_ret != VLC_SUCCESS )
{
return VLC_EGENERIC;
diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
index de0d5d83df..e6627ce1c1 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -885,7 +885,7 @@ static int Open( vlc_object_t * p_this )
input_item_t *p_item = input_item_New( psz_ref, NULL );
input_item_CopyOptions( p_item, p_current );
input_item_node_AppendItem( p_subitems, p_item );
- vlc_gc_decref( p_item );
+ input_item_Release( p_item );
}
else
{
diff --git a/modules/demux/playlist/asx.c b/modules/demux/playlist/asx.c
index b7432cdc3d..7d7863e8f7 100644
--- a/modules/demux/playlist/asx.c
+++ b/modules/demux/playlist/asx.c
@@ -460,7 +460,7 @@ static int Demux( demux_t *p_demux )
input_item_CopyOptions( p_input, p_current_input );
input_item_node_AppendItem( p_subitems, p_input );
- vlc_gc_decref( p_input );
+ input_item_Release( p_input );
}
else
/* Entry Handler */
@@ -496,7 +496,7 @@ error:
input_item_node_Delete( p_subitems );
if( p_stream )
vlc_stream_Delete( p_stream );
- vlc_gc_decref( p_current_input );
+ input_item_Release( p_current_input );
return 0;
}
diff --git a/modules/demux/playlist/b4s.c b/modules/demux/playlist/b4s.c
index 0f6acbfc0d..676cb04440 100644
--- a/modules/demux/playlist/b4s.c
+++ b/modules/demux/playlist/b4s.c
@@ -204,7 +204,7 @@ static int Demux( demux_t *p_demux )
msg_Err( p_demux, "Unsupported meta bitrate" );
input_item_node_AppendItem( p_subitems, p_input );
- vlc_gc_decref( p_input );
+ input_item_Release( p_input );
FREENULL( psz_title );
FREENULL( psz_mrl );
FREENULL( psz_genre );
@@ -230,7 +230,7 @@ end:
if( p_subitems )
input_item_node_PostAndDelete( p_subitems );
- vlc_gc_decref( p_current_input );
+ input_item_Release( p_current_input );
if( p_xml_reader )
xml_ReaderDelete( p_xml_reader );
return i_ret;
diff --git a/modules/demux/playlist/dvb.c b/modules/demux/playlist/dvb.c
index 5f82749922..48b49551ec 100644
--- a/modules/demux/playlist/dvb.c
+++ b/modules/demux/playlist/dvb.c
@@ -68,7 +68,7 @@ int Import_DVB(vlc_object_t *p_this)
input_item_t *item = ParseLine(line);
if (item == NULL)
return VLC_EGENERIC;
- vlc_gc_decref(item);
+ input_item_Release(item);
msg_Dbg(demux, "found valid channels.conf file");
demux->pf_control = Control;
@@ -92,11 +92,11 @@ static int Demux(demux_t *demux)
continue;
input_item_node_AppendItem(subitems, item);
- vlc_gc_decref(item);
+ input_item_Release(item);
}
input_item_node_PostAndDelete(subitems);
- vlc_gc_decref(input);
+ input_item_Release(input);
return 0; /* Needed for correct operation of go back */
}
diff --git a/modules/demux/playlist/gvp.c b/modules/demux/playlist/gvp.c
index de3e987f24..6cad202f32 100644
--- a/modules/demux/playlist/gvp.c
+++ b/modules/demux/playlist/gvp.c
@@ -172,12 +172,12 @@ static int Demux( demux_t *p_demux )
SADD_INFO( "docid", psz_docid );
SADD_INFO( "description", psz_desc );
input_item_node_AppendItem( p_subitems, p_input );
- vlc_gc_decref( p_input );
+ input_item_Release( p_input );
}
input_item_node_PostAndDelete( p_subitems );
- vlc_gc_decref(p_current_input);
+ input_item_Release(p_current_input);
free( psz_version );
free( psz_url );
diff --git a/modules/demux/playlist/ifo.c b/modules/demux/playlist/ifo.c
index 83e2526a94..5f0eae6949 100644
--- a/modules/demux/playlist/ifo.c
+++ b/modules/demux/playlist/ifo.c
@@ -107,9 +107,9 @@ static int Demux( demux_t *p_demux )
input_item_t *p_current_input = GetCurrentItem(p_demux);
input_item_t *p_input = input_item_New( psz_url, psz_url );
input_item_PostSubItem( p_current_input, p_input );
- vlc_gc_decref( p_input );
+ input_item_Release( p_input );
- vlc_gc_decref(p_current_input);
+ input_item_Release(p_current_input);
free( psz_url );
return 0; /* Needed for correct operation of go back */
@@ -131,9 +131,9 @@ static int DemuxDVD_VR( demux_t *p_demux )
input_item_t *p_input = input_item_New( psz_url, psz_url );
input_item_PostSubItem( p_current_input, p_input );
- vlc_gc_decref( p_input );
+ input_item_Release( p_input );
- vlc_gc_decref(p_current_input);
+ input_item_Release(p_current_input);
free( psz_url );
return 0; /* Needed for correct operation of go back */
diff --git a/modules/demux/playlist/itml.c b/modules/demux/playlist/itml.c
index 7e7dfc6399..68326e4bf2 100644
--- a/modules/demux/playlist/itml.c
+++ b/modules/demux/playlist/itml.c
@@ -113,7 +113,7 @@ int Demux( demux_t *p_demux )
pl_elements );
input_item_node_PostAndDelete( p_subitems );
- vlc_gc_decref(p_current_input);
+ input_item_Release(p_current_input);
end:
if( p_xml_reader )
@@ -334,7 +334,7 @@ static bool parse_track_dict( demux_t *p_demux, input_item_node_t *p_input_node,
/* add meta info */
add_meta( p_new_input, p_track );
- vlc_gc_decref( p_new_input );
+ input_item_Release( p_new_input );
p_demux->p_sys->i_ntracks++;
diff --git a/modules/demux/playlist/m3u.c b/modules/demux/playlist/m3u.c
index 27197ab112..d719350406 100644
--- a/modules/demux/playlist/m3u.c
+++ b/modules/demux/playlist/m3u.c
@@ -272,7 +272,7 @@ static int Demux( demux_t *p_demux )
input_item_SetArtURL( p_input, psz_album_art );
input_item_node_AppendItem( p_subitems, p_input );
- vlc_gc_decref( p_input );
+ input_item_Release( p_input );
}
error:
@@ -298,7 +298,7 @@ static int Demux( demux_t *p_demux )
}
}
input_item_node_PostAndDelete( p_subitems );
- vlc_gc_decref(p_current_input);
+ input_item_Release(p_current_input);
var_Destroy( p_demux, "m3u-extvlcopt" );
return 0; /* Needed for correct operation of go back */
}
diff --git a/modules/demux/playlist/pls.c b/modules/demux/playlist/pls.c
index 54fe0107a1..7664ff57fa 100644
--- a/modules/demux/playlist/pls.c
+++ b/modules/demux/playlist/pls.c
@@ -134,7 +134,7 @@ static int Demux( demux_t *p_demux )
p_input = input_item_New( psz_mrl, psz_name );
input_item_CopyOptions( p_input, p_current_input );
input_item_node_AppendItem( p_subitems, p_input );
- vlc_gc_decref( p_input );
+ input_item_Release( p_input );
free( psz_mrl_orig );
psz_mrl_orig = psz_mrl = NULL;
}
@@ -179,7 +179,7 @@ static int Demux( demux_t *p_demux )
p_input = input_item_New( psz_mrl, psz_name );
input_item_CopyOptions( p_input, p_current_input );
input_item_node_AppendItem( p_subitems, p_input );
- vlc_gc_decref( p_input );
+ input_item_Release( p_input );
free( psz_mrl_orig );
}
else
@@ -191,7 +191,7 @@ static int Demux( demux_t *p_demux )
input_item_node_PostAndDelete( p_subitems );
- vlc_gc_decref(p_current_input);
+ input_item_Release(p_current_input);
free( psz_prefix );
return 0; /* Needed for correct operation of go back */
}
diff --git a/modules/demux/playlist/podcast.c b/modules/demux/playlist/podcast.c
index e5a30e8e9c..7d21575eb1 100644
--- a/modules/demux/playlist/podcast.c
+++ b/modules/demux/playlist/podcast.c
@@ -297,7 +297,7 @@ static int Demux( demux_t *p_demux )
FREENULL( psz_item_size );
}
input_item_node_AppendItem( p_subitems, p_input );
- vlc_gc_decref( p_input );
+ input_item_Release( p_input );
b_item = false;
}
else if( !strcmp( node, "image" ) )
@@ -319,7 +319,7 @@ static int Demux( demux_t *p_demux )
xml_ReaderDelete( p_xml_reader );
input_item_node_PostAndDelete( p_subitems );
- vlc_gc_decref(p_current_input);
+ input_item_Release(p_current_input);
return 0; /* Needed for correct operation of go back */
error:
@@ -342,7 +342,7 @@ error:
if( p_subitems )
input_item_node_Delete( p_subitems );
- vlc_gc_decref(p_current_input);
+ input_item_Release(p_current_input);
return -1;
}
diff --git a/modules/demux/playlist/qtl.c b/modules/demux/playlist/qtl.c
index 0675159063..46d0d82421 100644
--- a/modules/demux/playlist/qtl.c
+++ b/modules/demux/playlist/qtl.c
@@ -244,13 +244,13 @@ static int Demux( demux_t *p_demux )
SADD_INFO( "href", psz_href );
SADD_INFO( _("Mime"), psz_mimetype );
input_item_node_AppendItem( p_subitems, p_input );
- vlc_gc_decref( p_input );
+ input_item_Release( p_input );
if( psz_qtnext )
{
vlc_xml_decode( psz_qtnext );
p_input = input_item_New( psz_qtnext, NULL );
input_item_node_AppendItem( p_subitems, p_input );
- vlc_gc_decref( p_input );
+ input_item_Release( p_input );
}
input_item_node_PostAndDelete( p_subitems );
}
@@ -261,7 +261,7 @@ error:
if( p_xml_reader )
xml_ReaderDelete( p_xml_reader );
- vlc_gc_decref(p_current_input);
+ input_item_Release(p_current_input);
free( psz_href );
free( psz_moviename );
diff --git a/modules/demux/playlist/ram.c b/modules/demux/playlist/ram.c
index 2195ff9ddf..aca7a57d9d 100644
--- a/modules/demux/playlist/ram.c
+++ b/modules/demux/playlist/ram.c
@@ -347,7 +347,7 @@ static int Demux( demux_t *p_demux )
if( !EMPTY_STR( psz_comments ) ) input_item_SetDescription( p_input, psz_comments );
input_item_node_AppendItem( p_subitems, p_input );
- vlc_gc_decref( p_input );
+ input_item_Release( p_input );
free( psz_mrl );
}
@@ -379,7 +379,7 @@ static int Demux( demux_t *p_demux )
}
}
input_item_node_PostAndDelete( p_subitems );
- vlc_gc_decref(p_current_input);
+ input_item_Release(p_current_input);
var_Destroy( p_demux, "m3u-extvlcopt" );
free(psz_prefix);
return 0; /* Needed for correct operation of go back */
diff --git a/modules/demux/playlist/sgimb.c b/modules/demux/playlist/sgimb.c
index 3ed03c7d22..017fdc245d 100644
--- a/modules/demux/playlist/sgimb.c
+++ b/modules/demux/playlist/sgimb.c
@@ -400,7 +400,7 @@ static int Demux ( demux_t *p_demux )
input_item_AddOption( p_child, "rtsp-kasenna", VLC_INPUT_OPTION_TRUSTED );
input_item_PostSubItem( p_current_input, p_child );
- vlc_gc_decref( p_child );
- vlc_gc_decref(p_current_input);
+ input_item_Release( p_child );
+ input_item_Release(p_current_input);
return 0; /* Needed for correct operation of go back */
}
diff --git a/modules/demux/playlist/shoutcast.c b/modules/demux/playlist/shoutcast.c
index 168be31801..f11f650431 100644
--- a/modules/demux/playlist/shoutcast.c
+++ b/modules/demux/playlist/shoutcast.c
@@ -120,7 +120,7 @@ error:
if( p_xml_reader )
xml_ReaderDelete( p_xml_reader );
if( p_input_node ) input_item_node_Delete( p_input_node );
- vlc_gc_decref(p_current_input);
+ input_item_Release(p_current_input);
return i_ret;
}
@@ -176,7 +176,7 @@ static int DemuxGenre( demux_t *p_demux, xml_reader_t *p_xml_reader,
input_item_CopyOptions( p_input, p_input_node->p_item );
free( psz_mrl );
input_item_node_AppendItem( p_input_node, p_input );
- vlc_gc_decref( p_input );
+ input_item_Release( p_input );
}
FREENULL( psz_name );
}
@@ -343,7 +343,7 @@ static int DemuxStation( demux_t *p_demux, xml_reader_t *p_xml_reader,
if( psz_rt )
input_item_SetRating( p_input, psz_rt );
input_item_node_AppendItem( p_input_node, p_input );
- vlc_gc_decref( p_input );
+ input_item_Release( p_input );
}
FREENULL( psz_base );
FREENULL( psz_name );
diff --git a/modules/demux/playlist/xspf.c b/modules/demux/playlist/xspf.c
index 73be5ced12..b3db813263 100644
--- a/modules/demux/playlist/xspf.c
+++ b/modules/demux/playlist/xspf.c
@@ -103,7 +103,7 @@ void Close_xspf(vlc_object_t *p_this)
demux_sys_t *p_sys = p_demux->p_sys;
for (int i = 0; i < p_sys->i_tracklist_entries; i++)
if (p_sys->pp_tracklist[i])
- vlc_gc_decref(p_sys->pp_tracklist[i]);
+ input_item_Release(p_sys->pp_tracklist[i]);
free(p_sys->pp_tracklist);
free(p_sys->psz_base);
free(p_sys);
@@ -160,7 +160,7 @@ static int Demux(demux_t *p_demux)
input_item_node_PostAndDelete(p_subitems);
end:
- vlc_gc_decref(p_current_input);
+ input_item_Release(p_current_input);
if (p_xml_reader)
xml_ReaderDelete(p_xml_reader);
return i_ret; /* Needed for correct operation of go back */
@@ -440,7 +440,7 @@ static bool parse_track_node COMPLEX_INTERFACE
|| (size_t)p_sys->i_track_id >= (SIZE_MAX / sizeof(p_new_input)))
{
input_item_node_AppendNode(p_input_node, p_new_node);
- vlc_gc_decref(p_new_input);
+ input_item_Release(p_new_input);
return true;
}
@@ -451,7 +451,7 @@ static bool parse_track_node COMPLEX_INTERFACE
(p_sys->i_track_id + 1) * sizeof(*pp));
if (!pp)
{
- vlc_gc_decref(p_new_input);
+ input_item_Release(p_new_input);
input_item_node_Delete(p_new_node);
return false;
}
@@ -462,7 +462,7 @@ static bool parse_track_node COMPLEX_INTERFACE
else if (p_sys->pp_tracklist[p_sys->i_track_id] != NULL)
{
msg_Err(p_demux, "track ID %d collision", p_sys->i_track_id);
- vlc_gc_decref(p_new_input);
+ input_item_Release(p_new_input);
input_item_node_Delete(p_new_node);
return false;
}
@@ -514,7 +514,7 @@ static bool parse_track_node COMPLEX_INTERFACE
end:
- vlc_gc_decref(p_new_input);
+ input_item_Release(p_new_input);
input_item_node_Delete(p_new_node);
free(psz_value);
return false;
@@ -676,7 +676,7 @@ static bool parse_extension_node COMPLEX_INTERFACE
{
msg_Err(p_demux, "invalid xml stream");
FREE_VALUE();
- if (b_release_input_item) vlc_gc_decref(p_new_input);
+ if (b_release_input_item) input_item_Release(p_new_input);
return false;
}
/* choose handler */
@@ -685,7 +685,7 @@ static bool parse_extension_node COMPLEX_INTERFACE
{
msg_Err(p_demux, "unexpected element <%s>", name);
FREE_VALUE();
- if (b_release_input_item) vlc_gc_decref(p_new_input);
+ if (b_release_input_item) input_item_Release(p_new_input);
return false;
}
/* complex content is parsed in a separate function */
@@ -702,7 +702,8 @@ static bool parse_extension_node COMPLEX_INTERFACE
else
{
FREE_VALUE();
- if (b_release_input_item) vlc_gc_decref(p_new_input);
+ if (b_release_input_item)
+ input_item_Release(p_new_input);
return false;
}
}
@@ -715,7 +716,7 @@ static bool parse_extension_node COMPLEX_INTERFACE
if (unlikely(!psz_value))
{
FREE_VALUE();
- if (b_release_input_item) vlc_gc_decref(p_new_input);
+ if (b_release_input_item) input_item_Release(p_new_input);
return false;
}
break;
@@ -726,7 +727,7 @@ static bool parse_extension_node COMPLEX_INTERFACE
if (!strcmp(name, psz_element))
{
FREE_VALUE();
- if (b_release_input_item) vlc_gc_decref(p_new_input);
+ if (b_release_input_item) input_item_Release(p_new_input);
return true;
}
/* there MUST have been a start tag for that element name */
@@ -736,7 +737,7 @@ static bool parse_extension_node COMPLEX_INTERFACE
msg_Err(p_demux, "there's no open element left for <%s>",
name);
FREE_VALUE();
- if (b_release_input_item) vlc_gc_decref(p_new_input);
+ if (b_release_input_item) input_item_Release(p_new_input);
return false;
}
@@ -755,7 +756,7 @@ static bool parse_extension_node COMPLEX_INTERFACE
break;
}
}
- if (b_release_input_item) vlc_gc_decref(p_new_input);
+ if (b_release_input_item) input_item_Release(p_new_input);
free(psz_value);
return false;
}
@@ -798,7 +799,7 @@ static bool parse_extitem_node COMPLEX_INTERFACE
if (p_new_input)
{
input_item_node_AppendItem(p_input_node, p_new_input);
- vlc_gc_decref(p_new_input);
+ input_item_Release(p_new_input);
p_demux->p_sys->pp_tracklist[i_tid] = NULL;
}
diff --git a/modules/gui/macosx/VLCConvertAndSaveWindowController.m b/modules/gui/macosx/VLCConvertAndSaveWindowController.m
index 088e2c3bd2..8d0fed16bd 100644
--- a/modules/gui/macosx/VLCConvertAndSaveWindowController.m
+++ b/modules/gui/macosx/VLCConvertAndSaveWindowController.m
@@ -301,7 +301,7 @@
msg_Err(getIntf(), "CAS: playlist add input failed :(");
/* we're done with this input */
- vlc_gc_decref(p_input);
+ input_item_Release(p_input);
[self.window performClose:sender];
}
diff --git a/modules/gui/macosx/VLCPlaylistInfo.m b/modules/gui/macosx/VLCPlaylistInfo.m
index a02be140b5..86c080bf15 100644
--- a/modules/gui/macosx/VLCPlaylistInfo.m
+++ b/modules/gui/macosx/VLCPlaylistInfo.m
@@ -123,7 +123,7 @@
- (void)dealloc
{
if (p_item)
- vlc_gc_decref(p_item);
+ input_item_Release(p_item);
}
- (void)updateCocoaWindowLevel:(NSInteger)i_level
@@ -178,7 +178,7 @@
{
if (_p_item != p_item) {
if (p_item)
- vlc_gc_decref(p_item);
+ input_item_Release(p_item);
[_saveMetaDataButton setEnabled: NO];
if (_p_item)
input_item_Hold(_p_item);
diff --git a/modules/gui/qt/components/interface_widgets.cpp b/modules/gui/qt/components/interface_widgets.cpp
index 5d034bae6f..081985dc2c 100644
--- a/modules/gui/qt/components/interface_widgets.cpp
+++ b/modules/gui/qt/components/interface_widgets.cpp
@@ -773,12 +773,12 @@ CoverArtLabel::~CoverArtLabel()
QList< QAction* > artActions = actions();
foreach( QAction *act, artActions )
removeAction( act );
- if ( p_item ) vlc_gc_decref( p_item );
+ if ( p_item ) input_item_Release( p_item );
}
void CoverArtLabel::setItem( input_item_t *_p_item )
{
- if ( p_item ) vlc_gc_decref( p_item );
+ if ( p_item ) input_item_Release( p_item );
p_item = _p_item;
if ( p_item ) input_item_Hold( p_item );
}
diff --git a/modules/gui/qt/components/playlist/playlist_item.cpp b/modules/gui/qt/components/playlist/playlist_item.cpp
index 2d5a0e0c8a..3b5af5c732 100644
--- a/modules/gui/qt/components/playlist/playlist_item.cpp
+++ b/modules/gui/qt/components/playlist/playlist_item.cpp
@@ -80,7 +80,7 @@ PLItem::PLItem( playlist_item_t * p_item )
PLItem::~PLItem()
{
- vlc_gc_decref( p_input );
+ input_item_Release( p_input );
qDeleteAll( children );
children.clear();
}
diff --git a/modules/gui/qt/components/playlist/playlist_model.cpp b/modules/gui/qt/components/playlist/playlist_model.cpp
index eaaf213c54..124ddebe66 100644
--- a/modules/gui/qt/components/playlist/playlist_model.cpp
+++ b/modules/gui/qt/components/playlist/playlist_model.cpp
@@ -1084,7 +1084,7 @@ bool PLModel::isSupportedAction( actions action, const QModelIndex &index ) cons
PlMimeData::~PlMimeData()
{
foreach( input_item_t *p_item, _inputItems )
- vlc_gc_decref( p_item );
+ input_item_Release( p_item );
}
void PlMimeData::appendItem( input_item_t *p_item )
diff --git a/modules/gui/qt/components/playlist/selector.cpp b/modules/gui/qt/components/playlist/selector.cpp
index 544618c4df..c02a024b24 100644
--- a/modules/gui/qt/components/playlist/selector.cpp
+++ b/modules/gui/qt/components/playlist/selector.cpp
@@ -171,7 +171,7 @@ PLSelector::~PLSelector()
{
QTreeWidgetItem *item = podcastsParent->child(i);
input_item_t *p_input = item->data( 0, IN_ITEM_ROLE ).value<input_item_t*>();
- vlc_gc_decref( p_input );
+ input_item_Release( p_input );
}
}
}
@@ -546,7 +546,7 @@ void PLSelector::plItemRemoved( int id )
{
input_item_t *p_input = item->data( 0, IN_ITEM_ROLE ).value<input_item_t*>();
//msg_Dbg( p_intf, "Removing podcast: (%d) %s", id, p_input->psz_uri );
- vlc_gc_decref( p_input );
+ input_item_Release( p_input );
delete item;
return;
}
diff --git a/modules/gui/qt/dialogs/epg.cpp b/modules/gui/qt/dialogs/epg.cpp
index 234162a655..48b15d7427 100644
--- a/modules/gui/qt/dialogs/epg.cpp
+++ b/modules/gui/qt/dialogs/epg.cpp
@@ -178,7 +178,7 @@ void EpgDialog::updateInfos()
if ( p_input_item )
{
epg->updateEPG( p_input_item );
- vlc_gc_decref( p_input_item );
+ input_item_Release( p_input_item );
}
else
{
diff --git a/modules/gui/qt/input_manager.hpp b/modules/gui/qt/input_manager.hpp
index a3e74b10f8..e79471ef0f 100644
--- a/modules/gui/qt/input_manager.hpp
+++ b/modules/gui/qt/input_manager.hpp
@@ -87,7 +87,7 @@ public:
virtual ~IMEvent()
{
if( p_item )
- vlc_gc_decref( p_item );
+ input_item_Release( p_item );
}
input_item_t *item() const { return p_item; };
diff --git a/modules/gui/skins2/commands/cmd_vars.hpp b/modules/gui/skins2/commands/cmd_vars.hpp
index 074fc9a88c..73aab30105 100644
--- a/modules/gui/skins2/commands/cmd_vars.hpp
+++ b/modules/gui/skins2/commands/cmd_vars.hpp
@@ -52,7 +52,7 @@ public:
virtual ~CmdItemUpdate()
{
if( m_pItem )
- vlc_gc_decref( m_pItem );
+ input_item_Release( m_pItem );
}
virtual void execute();
virtual std::string getType() const { return "playtree update"; }
diff --git a/modules/lua/extension.c b/modules/lua/extension.c
index c49f5336ee..fbfccbc670 100644
--- a/modules/lua/extension.c
+++ b/modules/lua/extension.c
@@ -590,7 +590,7 @@ static int Control( extensions_manager_t *p_mgr, int i_control, va_list args )
vlc_InputItemMetaChanged,
inputItemMetaChanged,
p_ext );
- vlc_gc_decref( p_item );
+ input_item_Release( p_item );
}
vlc_object_release( old );
}
@@ -669,7 +669,7 @@ int lua_ExtensionDeactivate( extensions_manager_t *p_mgr, extension_t *p_ext )
{
// Release item
input_item_t *p_item = input_GetItem( p_ext->p_sys->p_input );
- vlc_gc_decref( p_item );
+ input_item_Release( p_item );
}
vlc_object_release( p_ext->p_sys->p_input );
p_ext->p_sys->p_input = NULL;
diff --git a/modules/lua/libs/input.c b/modules/lua/libs/input.c
index 6ee3946cdb..b5ca73ab4c 100644
--- a/modules/lua/libs/input.c
+++ b/modules/lua/libs/input.c
@@ -262,7 +262,7 @@ static int vlclua_input_item_delete( lua_State *L )
return luaL_error( L, "script went completely foobar" );
*pp_item = NULL;
- vlc_gc_decref( p_item );
+ input_item_Release( p_item );
return 1;
}
diff --git a/modules/lua/libs/sd.c b/modules/lua/libs/sd.c
index 65c36c6576..f564dbf054 100644
--- a/modules/lua/libs/sd.c
+++ b/modules/lua/libs/sd.c
@@ -301,7 +301,7 @@ static int vlclua_sd_add_item( lua_State *L )
lua_setfield( L, -2, "__metatable" );
}
lua_setmetatable( L, -2 );
- vlc_gc_decref( p_input );
+ input_item_Release( p_input );
}
while( i_options > 0 )
free( ppsz_options[--i_options] );
@@ -397,7 +397,7 @@ static int vlclua_node_add_subitem( lua_State *L )
lua_setfield( L, -2, "__metatable" );
}
lua_setmetatable( L, -2 );
- vlc_gc_decref( p_input );
+ input_item_Release( p_input );
}
while( i_options > 0 )
free( ppsz_options[--i_options] );
diff --git a/modules/lua/vlc.c b/modules/lua/vlc.c
index c4cc243aa0..0270a4bd73 100644
--- a/modules/lua/vlc.c
+++ b/modules/lua/vlc.c
@@ -581,7 +581,7 @@ int vlclua_playlist_add_internal( vlc_object_t *p_this, lua_State *L,
( b_play ? PLAYLIST_GO : 0 ),
true );
i_count ++; /* increment counter */
- vlc_gc_decref( p_input );
+ input_item_Release( p_input );
while( i_options > 0 )
free( ppsz_options[--i_options] );
free( ppsz_options );
diff --git a/modules/services_discovery/avahi.c b/modules/services_discovery/avahi.c
index c1f7a7848e..3026b7aac9 100644
--- a/modules/services_discovery/avahi.c
+++ b/modules/services_discovery/avahi.c
@@ -206,7 +206,7 @@ static void resolve_callback(
vlc_dictionary_insert( &p_sys->services_name_to_input_item,
name, p_input );
services_discovery_AddItem( p_sd, p_input, NULL /* no category */ );
- vlc_gc_decref( p_input );
+ input_item_Release( p_input );
}
}
diff --git a/modules/services_discovery/mediadirs.c b/modules/services_discovery/mediadirs.c
index 9c76b6b25e..2dd2ab26d9 100644
--- a/modules/services_discovery/mediadirs.c
+++ b/modules/services_discovery/mediadirs.c
@@ -214,7 +214,7 @@ static void *Run( void *data )
vlc_event_detach( p_em, vlc_InputItemSubItemAdded,
input_item_subitem_added, p_sd );
- vlc_gc_decref( p_root );
+ input_item_Release( p_root );
free( psz_uri );
}
@@ -303,7 +303,7 @@ static int onNewFileAdded( vlc_object_t *p_this, char const *psz_var,
}
}
- vlc_gc_decref( p_item );
+ input_item_Release( p_item );
free( psz_uri );
return VLC_SUCCESS;
diff --git a/modules/services_discovery/mtp.c b/modules/services_discovery/mtp.c
index 99f15d8c78..0beaee7c74 100644
--- a/modules/services_discovery/mtp.c
+++ b/modules/services_discovery/mtp.c
@@ -282,7 +282,7 @@ static void CloseDevice( services_discovery_t *p_sd )
if( pp_items[i_i] != NULL )
{
services_discovery_RemoveItem( p_sd, pp_items[i_i] );
- vlc_gc_decref( pp_items[i_i] );
+ input_item_Release( pp_items[i_i] );
}
}
free( pp_items );
diff --git a/modules/services_discovery/podcast.c b/modules/services_discovery/podcast.c
index a99c0c15ef..f945193d75 100644
--- a/modules/services_discovery/podcast.c
+++ b/modules/services_discovery/podcast.c
@@ -197,7 +197,8 @@ static void Close( vlc_object_t *p_this )
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] );
+ for( i = 0; i < p_sys->i_items; i++ )
+ input_item_Release( p_sys->pp_items[i] );
free( p_sys->pp_items );
free( p_sys->psz_request );
free( p_sys );
@@ -348,7 +349,7 @@ static void ParseUrls( services_discovery_t *p_sd, char *psz_urls )
if( j == i_new_items )
{
services_discovery_RemoveItem( p_sd, p_sys->pp_items[i] );
- vlc_gc_decref( p_sys->pp_items[i] );
+ input_item_Release( p_sys->pp_items[i] );
}
}
free( p_sys->pp_items );
@@ -414,7 +415,7 @@ static void ParseRequest( services_discovery_t *p_sd )
if( i != p_sys->i_urls )
{
services_discovery_RemoveItem( p_sd, p_sys->pp_items[i] );
- vlc_gc_decref( p_sys->pp_items[i] );
+ input_item_Release( p_sys->pp_items[i] );
REMOVE_ELEM( p_sys->ppsz_urls, p_sys->i_urls, i );
REMOVE_ELEM( p_sys->pp_items, p_sys->i_items, i );
}
diff --git a/modules/services_discovery/pulse.c b/modules/services_discovery/pulse.c
index cca8c4ba24..2dd1ddd59b 100644
--- a/modules/services_discovery/pulse.c
+++ b/modules/services_discovery/pulse.c
@@ -121,7 +121,7 @@ static void DestroySource (void *data)
struct device *d = data;
services_discovery_RemoveItem (d->sd, d->item);
- vlc_gc_decref (d->item);
+ input_item_Release (d->item);
free (d);
}
@@ -157,7 +157,7 @@ static int AddSource (services_discovery_t *sd, const pa_source_info *info)
struct device *d = malloc (sizeof (*d));
if (unlikely(d == NULL))
{
- vlc_gc_decref (item);
+ input_item_Release (item);
return -1;
}
d->index = info->index;
@@ -167,7 +167,7 @@ static int AddSource (services_discovery_t *sd, const pa_source_info *info)
if (dp == NULL) /* Out-of-memory */
{
free (d);
- vlc_gc_decref (item);
+ input_item_Release (item);
return -1;
}
if (*dp != d) /* Update existing source */
@@ -176,7 +176,7 @@ static int AddSource (services_discovery_t *sd, const pa_source_info *info)
d = *dp;
input_item_SetURI (d->item, item->psz_uri);
input_item_SetName (d->item, item->psz_name);
- vlc_gc_decref (item);
+ input_item_Release (item);
return 0;
}
diff --git a/modules/services_discovery/sap.c b/modules/services_discovery/sap.c
index d18e5080c6..6fc5971daf 100644
--- a/modules/services_discovery/sap.c
+++ b/modules/services_discovery/sap.c
@@ -1561,7 +1561,7 @@ static int RemoveAnnounce( services_discovery_t *p_sd,
if( p_announce->p_item )
{
services_discovery_RemoveItem( p_sd, p_announce->p_item );
- vlc_gc_decref( p_announce->p_item );
+ input_item_Release( p_announce->p_item );
p_announce->p_item = NULL;
}
diff --git a/modules/services_discovery/udev.c b/modules/services_discovery/udev.c
index 61f3bfcb6d..0fd5824ebc 100644
--- a/modules/services_discovery/udev.c
+++ b/modules/services_discovery/udev.c
@@ -151,7 +151,7 @@ static void DestroyDevice (void *data)
if (d->sd)
services_discovery_RemoveItem (d->sd, d->item);
- vlc_gc_decref (d->item);
+ input_item_Release (d->item);
free (d);
}
@@ -179,7 +179,7 @@ static int AddDevice (services_discovery_t *sd, struct udev_device *dev)
struct device *d = malloc (sizeof (*d));
if (d == NULL)
{
- vlc_gc_decref (item);
+ input_item_Release (item);
return -1;
}
d->devnum = udev_device_get_devnum (dev);
diff --git a/modules/services_discovery/upnp.cpp b/modules/services_discovery/upnp.cpp
index 1028e57b1c..9c95cb8a94 100644
--- a/modules/services_discovery/upnp.cpp
+++ b/modules/services_discovery/upnp.cpp
@@ -281,7 +281,7 @@ MediaServerDesc::MediaServerDesc( const std::string& udn, const std::string& fNa
MediaServerDesc::~MediaServerDesc()
{
if (inputItem)
- vlc_gc_decref( inputItem );
+ input_item_Release( inputItem );
}
/*
diff --git a/modules/services_discovery/xcb_apps.c b/modules/services_discovery/xcb_apps.c
index 70b3c42f37..0f0c53fe51 100644
--- a/modules/services_discovery/xcb_apps.c
+++ b/modules/services_discovery/xcb_apps.c
@@ -265,7 +265,7 @@ static struct app *AddApp (services_discovery_t *sd, xcb_window_t xid)
struct app *app = malloc (sizeof (*app));
if (app == NULL)
{
- vlc_gc_decref (item);
+ input_item_Release (item);
return NULL;
}
app->xid = xid;
@@ -280,7 +280,7 @@ static void DelApp (void *data)
struct app *app = data;
services_discovery_RemoveItem (app->owner, app->item);
- vlc_gc_decref (app->item);
+ input_item_Release (app->item);
free (app);
}
diff --git a/src/input/input.c b/src/input/input.c
index 187a75160b..26d13a53d9 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -245,7 +245,7 @@ static void input_Destructor( vlc_object_t *obj )
if( priv->p_resource_private )
input_resource_Release( priv->p_resource_private );
- vlc_gc_decref( priv->p_item );
+ input_item_Release( priv->p_item );
vlc_mutex_destroy( &priv->counters.counters_lock );
diff --git a/src/input/item.c b/src/input/item.c
index dcbf2edf0a..743c3c6e99 100644
--- a/src/input/item.c
+++ b/src/input/item.c
@@ -1273,7 +1273,7 @@ static void RecursiveNodeDelete( input_item_node_t *p_node )
for( int i = 0; i < p_node->i_children; i++ )
RecursiveNodeDelete( p_node->pp_children[i] );
- vlc_gc_decref( p_node->p_item );
+ input_item_Release( p_node->p_item );
free( p_node->pp_children );
free( p_node );
}
diff --git a/src/input/vlm.c b/src/input/vlm.c
index 75b40faa16..49ec17cfdd 100644
--- a/src/input/vlm.c
+++ b/src/input/vlm.c
@@ -587,7 +587,7 @@ static int vlm_OnMediaUpdate( vlm_t *p_vlm, vlm_media_sys_t *p_media )
char *psz_header;
char *psz_dup;
- vlc_gc_decref( p_media->vod.p_item );
+ input_item_Release( p_media->vod.p_item );
if( strstr( p_cfg->ppsz_input[0], "://" ) == NULL )
{
@@ -795,7 +795,7 @@ static int vlm_ControlMediaDel( vlm_t *p_vlm, int64_t id )
vlm_media_Clean( &p_media->cfg );
- vlc_gc_decref( p_media->vod.p_item );
+ input_item_Release( p_media->vod.p_item );
if( p_media->vod.p_media )
p_vlm->p_vod->pf_media_del( p_vlm->p_vod, p_media->vod.p_media );
@@ -895,7 +895,7 @@ static void vlm_MediaInstanceDelete( vlm_t *p_vlm, int64_t id, vlm_media_instanc
vlc_object_release( p_instance->p_parent );
TAB_REMOVE( p_media->i_instance, p_media->instance, p_instance );
- vlc_gc_decref( p_instance->p_item );
+ input_item_Release( p_instance->p_item );
free( p_instance->psz_name );
free( p_instance );
}
diff --git a/src/playlist/item.c b/src/playlist/item.c
index 5332b5204f..97d1433aff 100644
--- a/src/playlist/item.c
+++ b/src/playlist/item.c
@@ -341,7 +341,7 @@ void playlist_ItemRelease( playlist_t *p_playlist, playlist_item_t *p_item )
vlc_event_detach( p_em, vlc_InputItemErrorWhenReadingChanged,
input_item_changed, p_playlist );
- vlc_gc_decref( p_item->p_input );
+ input_item_Release( p_item->p_input );
tdelete( p_item, &p->input_tree, playlist_ItemCmpInput );
tdelete( p_item, &p->id_tree, playlist_ItemCmpId );
@@ -468,7 +468,7 @@ int playlist_AddExt( playlist_t *p_playlist, const char * psz_uri,
return VLC_ENOMEM;
input_item_AddOptions( p_input, i_options, ppsz_options, i_option_flags );
i_ret = playlist_AddInput( p_playlist, p_input, i_mode, b_playlist );
- vlc_gc_decref( p_input );
+ input_item_Release( p_input );
return i_ret;
}
@@ -886,7 +886,7 @@ static int RecursiveInsertCopy (
{
p_new_item = playlist_NodeAddInput( p_playlist, p_new_input,
p_parent, 0, i_pos );
- vlc_gc_decref( p_new_input );
+ input_item_Release( p_new_input );
}
}
else
diff --git a/src/playlist/loadsave.c b/src/playlist/loadsave.c
index 9b0533b69c..bb3ae6afb2 100644
--- a/src/playlist/loadsave.c
+++ b/src/playlist/loadsave.c
@@ -171,7 +171,7 @@ int playlist_MLLoad( playlist_t *p_playlist )
vlc_event_detach( &p_input->event_manager, vlc_InputItemSubItemTreeAdded,
input_item_subitem_tree_added, p_playlist );
- vlc_gc_decref( p_input );
+ input_item_Release( p_input );
return VLC_SUCCESS;
}
diff --git a/src/playlist/tree.c b/src/playlist/tree.c
index e8a99ca2f1..dc129292ce 100644
--- a/src/playlist/tree.c
+++ b/src/playlist/tree.c
@@ -71,7 +71,7 @@ playlist_item_t * playlist_NodeCreate( playlist_t *p_playlist,
if( !p_new_input )
return NULL;
p_item = playlist_ItemNewFromInput( p_playlist, p_new_input );
- vlc_gc_decref( p_new_input );
+ input_item_Release( p_new_input );
if( p_item == NULL ) return NULL;
p_item->i_children = 0;
More information about the vlc-commits
mailing list