[vlc-commits] qt: handle multiple track selection

Thomas Guillem git at videolan.org
Tue Jun 25 20:55:39 CEST 2019


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu Jun 20 17:45:58 2019 +0200| [7da60b80cb622eeff3f539d8d6d0a324520f46a1] | committer: Thomas Guillem

qt: handle multiple track selection

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

 modules/gui/qt/util/input_models.cpp | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/modules/gui/qt/util/input_models.cpp b/modules/gui/qt/util/input_models.cpp
index 0a0e450852..02b4b66455 100644
--- a/modules/gui/qt/util/input_models.cpp
+++ b/modules/gui/qt/util/input_models.cpp
@@ -62,8 +62,14 @@ bool TrackListModel::setData(const QModelIndex &index, const QVariant &value, in
     vlc_player_locker lock{ m_player };
 
     if (select)
-        vlc_player_SelectEsId(m_player, m_data[row].m_id.get(),
-                              VLC_PLAYER_SELECT_EXCLUSIVE);
+    {
+        vlc_es_id_t *es_id = m_data[row].m_id.get();
+        const enum es_format_category_e cat = vlc_es_id_GetCat(es_id);
+        enum vlc_player_select_policy policy =
+            cat == VIDEO_ES ? VLC_PLAYER_SELECT_SIMULTANEOUS
+                            : VLC_PLAYER_SELECT_EXCLUSIVE;
+        vlc_player_SelectEsId(m_player, es_id, policy);
+    }
     else
         vlc_player_UnselectEsId(m_player, m_data[row].m_id.get());
     return true;



More information about the vlc-commits mailing list