[vlc-devel] [PATCH] input: Fill in the input_item es.

Rémi Denis-Courmont remi at remlab.net
Sun Oct 17 11:06:55 CEST 2010


Le dimanche 17 octobre 2010 11:53:37 Rafaël Carré, vous avez écrit :
> Hi, I'm sending pdherbemont's patch synced to master, with some small
> changes:
> 	s/This is mostly libvlc_media_es_t/This is exactly
> libvlc_media_track_info_t/ remove 'found' variable from
> input_item_UpdateTracksInfo()
> 	check malloc() return value
> 
> However I'm wondering why this is really needed:
> 	How big is the memory improvement ?
> 	How does this "allow libvlc_media_get_es() to properly work after
> libvlc_media_parse()" ? -> IIUC we still need to play the media to get
> information from the decoder
> 
> Original thread:
> http://mailman.videolan.org/pipermail/vlc-devel/2010-February/073702.html

/* Called by es_out when a new Elementary Stream is added or updated. */
+void input_item_UpdateTracksInfo(input_item_t *item, const es_format_t *fmt)
+{
+    int i;
+
+    vlc_mutex_lock( &item->lock );
+
+    input_item_track_info_t *track_info = track_info_new_from_format(fmt);
+    if( !track_info )
+    {
+        vlc_mutex_unlock( &item->lock );
+        return NULL;
+    }

Why do you need the mutex there? Otherwise, this looks fine to me.

-- 
Rémi Denis-Courmont
http://www.remlab.net/
http://fi.linkedin.com/in/remidenis



More information about the vlc-devel mailing list