]> git.sesse.net Git - vlc/commitdiff
search.c: Fix 21193.
authorPierre d'Herbemont <pdherbemont@videolan.org>
Sat, 18 Aug 2007 04:59:18 +0000 (04:59 +0000)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Sat, 18 Aug 2007 04:59:18 +0000 (04:59 +0000)
src/playlist/search.c

index 15c29f603965255e48959aefbbd17f054bfcc7f5..4d6086581652b4f7b2af01d368b33f9eb94b6965 100644 (file)
@@ -115,6 +115,7 @@ int playlist_LiveSearchUpdate( playlist_t *p_playlist, playlist_item_t *p_root,
    p_playlist->b_reset_currently_playing = VLC_TRUE;
    for( i = 0 ; i< p_root->i_children ; i ++ )
    {
+
         playlist_item_t *p_item = p_root->pp_children[i];
         if( p_item->i_children > -1 )
         {
@@ -122,30 +123,16 @@ int playlist_LiveSearchUpdate( playlist_t *p_playlist, playlist_item_t *p_root,
         }
         else
         {
-            char *psz_name_matches, *psz_artist_matches, *psz_album_matches;
-            char *psz_field, *psz_field_case;
-
-            psz_field = input_item_GetName( p_i );
-            psz_name_matches = strcasestr( psz_field, psz_string );
-            free( psz_field );
-
-            psz_field = input_item_GetMeta( p_item->p_input, vlc_meta_Artist );
-            psz_field_case = strcasestr( input_item_GetMeta( p_item->p_input, vlc_meta_Artist ), psz_string );
-            psz_artist_matches = ( psz_field && psz_field_case );
-            free( psz_field );
-            free( psz_field_case );
-
-
-            psz_field = input_item_GetMeta( p_item->p_input, vlc_meta_Album );
-            psz_field_case = strcasestr( input_item_GetMeta( p_item->p_input, vlc_meta_Album ), psz_string );
-            psz_album_matches = ( psz_field && psz_field_case );
-            free( psz_field );
-            free( psz_field_case );
-
-            if( psz_name_matches || psz_artist_matches || psz_album_matches )
+            if( strcasestr( p_item->p_input->psz_name, psz_string ) || /* Soon to be replaced by vlc_meta_Title */
+                input_item_MetaMatch( p_item->p_input, vlc_meta_Album, psz_string ) ||
+                input_item_MetaMatch( p_item->p_input, vlc_meta_Artist, psz_string ) )
+            {
                 p_item->i_flags &= ~PLAYLIST_DBL_FLAG;
+            }
             else
+            {
                 p_item->i_flags |= PLAYLIST_DBL_FLAG;
+            }
         }
    }
    vlc_cond_signal( &p_playlist->object_wait );