[vlc-commits] input item: simplify copying title from meta

Rémi Denis-Courmont git at videolan.org
Fri Aug 15 18:46:45 CEST 2014


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Aug 15 18:41:21 2014 +0300| [3f9ebd2ff97ea7ca61a61149564584f5f0cb42e1] | committer: Rémi Denis-Courmont

input item: simplify copying title from meta

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

 src/input/es_out.c |   13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/src/input/es_out.c b/src/input/es_out.c
index ea7316e..03a494c 100644
--- a/src/input/es_out.c
+++ b/src/input/es_out.c
@@ -1347,17 +1347,15 @@ static void EsOutMeta( es_out_t *p_out, const vlc_meta_t *p_meta )
 {
     es_out_sys_t    *p_sys = p_out->p_sys;
     input_thread_t  *p_input = p_sys->p_input;
-
     input_item_t *p_item = input_GetItem( p_input );
 
-    char *psz_title = NULL;
+    if( vlc_meta_Get( p_meta, vlc_meta_Title ) != NULL )
+        input_item_SetName( p_item, vlc_meta_Get( p_meta, vlc_meta_Title ) );
+
     char *psz_arturl = input_item_GetArtURL( p_item );
 
     vlc_mutex_lock( &p_item->lock );
 
-    if( vlc_meta_Get( p_meta, vlc_meta_Title ) )
-        psz_title = strdup( vlc_meta_Get( p_meta, vlc_meta_Title ) );
-
     vlc_meta_Merge( p_item->p_meta, p_meta );
 
     if( !psz_arturl || *psz_arturl == '\0' )
@@ -1384,11 +1382,6 @@ static void EsOutMeta( es_out_t *p_out, const vlc_meta_t *p_meta )
     }
     free( psz_arturl );
 
-    if( psz_title )
-    {
-        input_item_SetName( p_item, psz_title );
-        free( psz_title );
-    }
     input_item_SetPreparsed( p_item, true );
 
     input_SendEventMeta( p_input );



More information about the vlc-commits mailing list