Commit 9998c1ec authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

vlc_input.h: Fix funman's commit.

parent 663adcbf
...@@ -221,11 +221,12 @@ static inline void input_ItemClean( input_item_t *p_i ) ...@@ -221,11 +221,12 @@ static inline void input_ItemClean( input_item_t *p_i )
static inline void input_item_SetMeta( input_item_t *p_i, vlc_meta_type_t meta_type, const char *psz_val ) static inline void input_item_SetMeta( input_item_t *p_i, vlc_meta_type_t meta_type, const char *psz_val )
{ {
vlc_event_t event; vlc_event_t event;
vlc_mutex_lock( &p_i->p_lock );
vlc_mutex_lock( &p_i->lock );
if( !p_i->p_meta ) if( !p_i->p_meta )
p_i->p_meta = vlc_meta_New(); p_i->p_meta = vlc_meta_New();
vlc_meta_Set( p_i->p_meta, meta_type, psz_val ); vlc_meta_Set( p_i->p_meta, meta_type, psz_val );
vlc_mutex_unlock( &p_i->p_lock ); vlc_mutex_unlock( &p_i->lock );
/* Notify interested third parties */ /* Notify interested third parties */
event.type = vlc_InputItemMetaChanged; event.type = vlc_InputItemMetaChanged;
...@@ -235,22 +236,27 @@ static inline void input_item_SetMeta( input_item_t *p_i, vlc_meta_type_t meta_t ...@@ -235,22 +236,27 @@ static inline void input_item_SetMeta( input_item_t *p_i, vlc_meta_type_t meta_t
static inline char * input_item_GetMeta( input_item_t *p_i, vlc_meta_type_t meta_type ) static inline char * input_item_GetMeta( input_item_t *p_i, vlc_meta_type_t meta_type )
{ {
vlc_mutex_lock( &p_i->p_lock ); char * psz = NULL;
vlc_mutex_lock( &p_i->lock );
if( !p_i->p_meta ) if( !p_i->p_meta )
{ {
vlc_mutex_unlock( &p_i->p_lock ); vlc_mutex_unlock( &p_i->lock );
return NULL; return NULL;
} }
char *psz_s = strdup( vlc_meta_Get( p_i->p_meta, meta_type ) );
vlc_mutex_unlock( &p_i->p_lock ); if( vlc_meta_Get( p_i->p_meta, meta_type ) )
return psz_s; psz = strdup( vlc_meta_Get( p_i->p_meta, meta_type ) );
vlc_mutex_unlock( &p_i->lock );
return psz;
} }
static inline char * input_item_GetName( input_item_t *p_i ) static inline char * input_item_GetName( input_item_t *p_i )
{ {
vlc_mutex_lock( &p_i->p_lock ); vlc_mutex_lock( &p_i->lock );
char *psz_s = strdup( p_i->psz_name ); char *psz_s = p_i->psz_name ? strdup( p_i->psz_name ) : NULL;
vlc_mutex_unlock( &p_i->p_lock ); vlc_mutex_unlock( &p_i->lock );
return psz_s; return psz_s;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment