[vlc-commits] vlm: make media a VLC object

Rémi Denis-Courmont git at videolan.org
Wed Feb 20 16:36:10 CET 2019


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Feb 19 21:57:49 2019 +0200| [d92e954471868cce3357ef33c00c2a61ee693dd2] | committer: Rémi Denis-Courmont

vlm: make media a VLC object

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d92e954471868cce3357ef33c00c2a61ee693dd2
---

 src/input/vlm.c          | 5 +++--
 src/input/vlm_internal.h | 1 +
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/input/vlm.c b/src/input/vlm.c
index 745691de6d..ca5821b10b 100644
--- a/src/input/vlm.c
+++ b/src/input/vlm.c
@@ -748,7 +748,8 @@ static int vlm_ControlMediaAdd( vlm_t *p_vlm, vlm_media_t *p_cfg, int64_t *p_id
         p_vlm->p_vod->pf_media_control = vlm_MediaVodControl;
     }
 
-    p_media = calloc( 1, sizeof( vlm_media_sys_t ) );
+    p_media = vlc_custom_create( VLC_OBJECT(p_vlm), sizeof( *p_media ),
+                                 "media" );
     if( !p_media )
         return VLC_ENOMEM;
 
@@ -799,7 +800,7 @@ static int vlm_ControlMediaDel( vlm_t *p_vlm, int64_t id )
         p_vlm->p_vod->pf_media_del( p_vlm->p_vod, p_media->vod.p_media );
 
     TAB_REMOVE( p_vlm->i_media, p_vlm->media, p_media );
-    free( p_media );
+    vlc_object_release( p_media );
 
     return VLC_SUCCESS;
 }
diff --git a/src/input/vlm_internal.h b/src/input/vlm_internal.h
index e3a97f86fa..205d80c423 100644
--- a/src/input/vlm_internal.h
+++ b/src/input/vlm_internal.h
@@ -47,6 +47,7 @@ typedef struct
 
 typedef struct
 {
+    struct vlc_common_members obj;
     vlm_media_t cfg;
 
     struct



More information about the vlc-commits mailing list