[vlc-devel] [PATCH 07/12] player: Add a currently selected track getter

Hugo Beauzée-Luyssen hugo at beauzee.fr
Wed Jul 31 11:20:36 CEST 2019


---
 src/input/player.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/input/player.c b/src/input/player.c
index 4d0e13c668..e53849dc21 100644
--- a/src/input/player.c
+++ b/src/input/player.c
@@ -881,6 +881,17 @@ static bool vlc_player_destructor_IsEmpty(vlc_player_t *player)
         && vlc_list_is_empty(&player->destructor.joinable_inputs);
 }
 
+static int vlc_player_selected_track( const vlc_player_track_vector* tracks )
+{
+    struct vlc_player_track_priv* t;
+    vlc_vector_foreach(t, tracks)
+    {
+        if (t->t.selected)
+            return t->t.fmt.i_id;
+    }
+    return 0;
+}
+
 static void *
 vlc_player_destructor_Thread(void *data)
 {
-- 
2.20.1



More information about the vlc-devel mailing list