]> git.sesse.net Git - vlc/blobdiff - src/playlist/sort.c
Add URI column to Qt4 playlist. Add sorting by URI in playlist core.
[vlc] / src / playlist / sort.c
index e7c5f6e116b056080cc8d00c0a6486ed24a70d04..e8b6f3c658582189be9eb462257344bef4fd3ef6 100644 (file)
@@ -236,8 +236,17 @@ static int playlist_cmp(const void *first, const void *second)
                                  (*(playlist_item_t **)second)->p_input->psz_name );
         }
     }
+    else if( sort_mode == SORT_URI )
+    {
+        char *psz_i = input_item_GetURI( (*(playlist_item_t **)first)->p_input );
+        char *psz_ismall =
+                input_item_GetURI( (*(playlist_item_t **)second)->p_input );
+        i_test = strcasecmp( psz_i, psz_ismall );
+        free( psz_i );
+        free( psz_ismall );
+    }
 
-    if ( sort_type == ORDER_REVERSE ) 
+    if ( sort_type == ORDER_REVERSE )
         i_test = i_test * -1;
 #undef DO_META_SORT
 #undef DO_META_SORT_ADV