- char *psz_name_matches, *psz_artist_matches, *psz_album_matches;
- char *psz_field, *psz_field_case;
+ vlc_mutex_lock( &p_item->p_input->lock );
+ // Do we have some meta ?
+ if( p_item->p_input->p_meta )
+ {
+ // Use Title or fall back to psz_name
+ const char *psz_title = vlc_meta_Get( p_item->p_input->p_meta, vlc_meta_Title );
+ if( !psz_title )
+ psz_title = p_item->p_input->psz_name;
+ const char *psz_album = vlc_meta_Get( p_item->p_input->p_meta, vlc_meta_Album );
+ const char *psz_artist = vlc_meta_Get( p_item->p_input->p_meta, vlc_meta_Artist );
+ b_enable = ( psz_title && strcasestr( psz_title, psz_string ) ) ||
+ ( psz_album && strcasestr( psz_album, psz_string ) ) ||
+ ( psz_artist && strcasestr( psz_artist, psz_string ) );
+ }
+ else
+ b_enable = p_item->p_input->psz_name && strcasestr( p_item->p_input->psz_name, psz_string );
+ vlc_mutex_unlock( &p_item->p_input->lock );
+ }