[vlc-commits] playlist: Allow sorting by disc number

Wieland Hoffmann git at videolan.org
Mon Feb 29 15:08:09 CET 2016


vlc | branch: master | Wieland Hoffmann <themineo at gmail.com> | Sun Feb 28 21:06:51 2016 +0100| [03b90ce5f354b5ce93a351cc6426afdc3ced6122] | committer: Jean-Baptiste Kempf

playlist: Allow sorting by disc number

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 include/vlc_input_item.h |    1 +
 include/vlc_playlist.h   |    3 ++-
 src/playlist/sort.c      |    5 +++++
 3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/include/vlc_input_item.h b/include/vlc_input_item.h
index 4391c72..8d20efa 100644
--- a/include/vlc_input_item.h
+++ b/include/vlc_input_item.h
@@ -259,6 +259,7 @@ INPUT_META(Season)
 INPUT_META(Episode)
 INPUT_META(ShowName)
 INPUT_META(Actors)
+INPUT_META(DiscNumber)
 
 #define input_item_SetTrackNum input_item_SetTrackNumber
 #define input_item_GetTrackNum input_item_GetTrackNumber
diff --git a/include/vlc_playlist.h b/include/vlc_playlist.h
index b116455..177ffa7 100644
--- a/include/vlc_playlist.h
+++ b/include/vlc_playlist.h
@@ -206,7 +206,8 @@ struct playlist_add_t
     DEF( SORT_TRACK_NUMBER )\
     DEF( SORT_DESCRIPTION )\
     DEF( SORT_RATING )\
-    DEF( SORT_URI )
+    DEF( SORT_URI )\
+    DEF( SORT_DISC_NUMBER )
 
 #define DEF( s ) s,
 enum
diff --git a/src/playlist/sort.c b/src/playlist/sort.c
index 2b91a90..e0307db 100644
--- a/src/playlist/sort.c
+++ b/src/playlist/sort.c
@@ -306,6 +306,11 @@ SORTFN( SORT_TRACK_NUMBER, first, second )
     return meta_sort( first, second, vlc_meta_TrackNumber, true );
 }
 
+SORTFN( SORT_DISC_NUMBER, first, second )
+{
+  return meta_sort( first, second, vlc_meta_DiscNumber, true );
+}
+
 SORTFN( SORT_URI, first, second )
 {
     int i_ret;



More information about the vlc-commits mailing list