[vlc-commits] player: add selected_by_user in tracks

Thomas Guillem git at videolan.org
Fri Feb 28 20:46:45 CET 2020


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Feb 28 13:28:49 2020 +0100| [1f5126d112d77fc82a5bc660a1296ff005f3e009] | committer: Thomas Guillem

player: add selected_by_user in tracks

It will be used to get the tracks specifically selected by the users.

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

 src/player/input.c  | 2 ++
 src/player/player.h | 2 ++
 src/player/track.c  | 1 +
 3 files changed, 5 insertions(+)

diff --git a/src/player/input.c b/src/player/input.c
index 1d689c2a9d..7fccd70b91 100644
--- a/src/player/input.c
+++ b/src/player/input.c
@@ -494,6 +494,7 @@ vlc_player_input_HandleEsEvent(struct vlc_player_input *input,
             if (trackpriv)
             {
                 trackpriv->t.selected = true;
+                trackpriv->selected_by_user = ev->forced;
                 vlc_player_SendEvent(player, on_track_selection_changed,
                                      NULL, trackpriv->t.es_id);
             }
@@ -524,6 +525,7 @@ vlc_player_input_HandleEsEvent(struct vlc_player_input *input,
             {
                 vlc_player_RemoveTimerSource(player, ev->id);
                 trackpriv->t.selected = false;
+                trackpriv->selected_by_user = false;
                 vlc_player_SendEvent(player, on_track_selection_changed,
                                      trackpriv->t.es_id, NULL);
             }
diff --git a/src/player/player.h b/src/player/player.h
index 202821ce23..8148d6cb62 100644
--- a/src/player/player.h
+++ b/src/player/player.h
@@ -36,6 +36,8 @@ struct vlc_player_track_priv
     vlc_tick_t delay;
     /* only valid if selected and if category is VIDEO_ES or SPU_ES */
     enum vlc_vout_order vout_order;
+    /* Used to save or not the track selection */
+    bool selected_by_user;
 };
 
 typedef struct VLC_VECTOR(struct vlc_player_program *)
diff --git a/src/player/track.c b/src/player/track.c
index b02f8d5881..7a519a14aa 100644
--- a/src/player/track.c
+++ b/src/player/track.c
@@ -113,6 +113,7 @@ vlc_player_track_priv_New(vlc_es_id_t *id, const char *name, const es_format_t *
     trackpriv->delay = INT64_MAX;
     trackpriv->vout = NULL;
     trackpriv->vout_order = VLC_VOUT_ORDER_NONE;
+    trackpriv->selected_by_user = false;
 
     track->name = strdup(name);
     if (!track->name)



More information about the vlc-commits mailing list