Replace vlc_gc_decref() with input_item_Release()
authorRémi Denis-Courmont <remi@remlab.net>
Sun, 9 Apr 2017 14:26:19 +0000 (17:26 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Sun, 9 Apr 2017 14:28:19 +0000 (17:28 +0300)
49 files changed:
include/vlc_fingerprinter.h
include/vlc_input_item.h
lib/media.c
lib/media_list.c
modules/access/dsm/sd.c
modules/control/oldrc.c
modules/demux/mp4/mp4.c
modules/demux/playlist/asx.c
modules/demux/playlist/b4s.c
modules/demux/playlist/dvb.c
modules/demux/playlist/gvp.c
modules/demux/playlist/ifo.c
modules/demux/playlist/itml.c
modules/demux/playlist/m3u.c
modules/demux/playlist/pls.c
modules/demux/playlist/podcast.c
modules/demux/playlist/qtl.c
modules/demux/playlist/ram.c
modules/demux/playlist/sgimb.c
modules/demux/playlist/shoutcast.c
modules/demux/playlist/xspf.c
modules/gui/macosx/VLCConvertAndSaveWindowController.m
modules/gui/macosx/VLCPlaylistInfo.m
modules/gui/qt/components/interface_widgets.cpp
modules/gui/qt/components/playlist/playlist_item.cpp
modules/gui/qt/components/playlist/playlist_model.cpp
modules/gui/qt/components/playlist/selector.cpp
modules/gui/qt/dialogs/epg.cpp
modules/gui/qt/input_manager.hpp
modules/gui/skins2/commands/cmd_vars.hpp
modules/lua/extension.c
modules/lua/libs/input.c
modules/lua/libs/sd.c
modules/lua/vlc.c
modules/services_discovery/avahi.c
modules/services_discovery/mediadirs.c
modules/services_discovery/mtp.c
modules/services_discovery/podcast.c
modules/services_discovery/pulse.c
modules/services_discovery/sap.c
modules/services_discovery/udev.c
modules/services_discovery/upnp.cpp
modules/services_discovery/xcb_apps.c
src/input/input.c
src/input/item.c
src/input/vlm.c
src/playlist/item.c
src/playlist/loadsave.c
src/playlist/tree.c

index e7986f5..01bbcab 100644 (file)
@@ -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 ) );
index 950d25f..461bab9 100644 (file)
@@ -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,
index 49a2bea..4c95c94 100644 (file)
@@ -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 );
index 53c1b6c..5274969 100644 (file)
@@ -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;
     }
 
index 871cd68..b6252fd 100644 (file)
@@ -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 );
index 02852c5..d33a74c 100644 (file)
@@ -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;
index de0d5d8..e6627ce 100644 (file)
@@ -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
             {
index b7432cd..7d7863e 100644 (file)
@@ -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;
 }
index 0f6acbf..676cb04 100644 (file)
@@ -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;
index 5f82749..48b4955 100644 (file)
@@ -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 */
 }
index de3e987..6cad202 100644 (file)
@@ -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 );
index 83e2526..5f0eae6 100644 (file)
@@ -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 */
index 7e7dfc6..68326e4 100644 (file)
@@ -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++;
 
index 27197ab..d719350 100644 (file)
@@ -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 */
 }
index 54fe010..7664ff5 100644 (file)
@@ -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 */
 }
index e5a30e8..7d21575 100644 (file)
@@ -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;
 }
 
index 0675159..46d0d82 100644 (file)
@@ -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 );
index 2195ff9..aca7a57 100644 (file)
@@ -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 */
index 3ed03c7..017fdc2 100644 (file)
@@ -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 */
 }
index 168be31..f11f650 100644 (file)
@@ -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 );
index 73be5ce..b3db813 100644 (file)
@@ -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;
     }
 
index 088e2c3..8d0fed1 100644 (file)
         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];
 }
index a02be14..86c080b 100644 (file)
 - (void)dealloc
 {
     if (p_item)
-        vlc_gc_decref(p_item);
+        input_item_Release(p_item);
 }
 
 - (void)updateCocoaWindowLevel:(NSInteger)i_level
 {
     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);
index 5d034ba..081985d 100644 (file)
@@ -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 );
 }
index 2d5a0e0..3b5af5c 100644 (file)
@@ -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();
 }
index eaaf213..124ddeb 100644 (file)
@@ -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 )
index 544618c..c02a024 100644 (file)
@@ -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;
         }
index 234162a..48b15d7 100644 (file)
@@ -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
         {
index a3e74b1..e79471e 100644 (file)
@@ -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; };
index 074fc9a..73aab30 100644 (file)
@@ -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"; }
index c49f533..fbfccbc 100644 (file)
@@ -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;
index 6ee3946..b5ca73a 100644 (file)
@@ -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;
 }
index 65c36c6..f564dbf 100644 (file)
@@ -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] );
index c4cc243..0270a4b 100644 (file)
@@ -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 );
index c1f7a78..3026b7a 100644 (file)
@@ -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 );
        }
     }
 
index 9c76b6b..2dd2ab2 100644 (file)
@@ -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;
index 99f15d8..0beaee7 100644 (file)
@@ -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 );
index a99c0c1..f945193 100644 (file)
@@ -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 );
         }
index cca8c4b..2dd1ddd 100644 (file)
@@ -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;
     }
 
index d18e508..6fc5971 100644 (file)
@@ -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;
     }
 
index 61f3bfc..0fd5824 100644 (file)
@@ -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);
index 1028e57..9c95cb8 100644 (file)
@@ -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 );
 }
 
 /*
index 70b3c42..0f0c53f 100644 (file)
@@ -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);
 }
 
index 187a751..26d13a5 100644 (file)
@@ -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 );
 
index dcbf2ed..743c3c6 100644 (file)
@@ -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 );
 }
index 75b40fa..49ec17c 100644 (file)
@@ -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 );
 }
index 5332b52..97d1433 100644 (file)
@@ -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
index 9b0533b..bb3ae6a 100644 (file)
@@ -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;
 }
index e8a99ca..dc12929 100644 (file)
@@ -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;