[vlc-devel] [PATCH] qt: force signals from the player callbacks to be emitted from a queued connection

Pierre Lamot pierre at videolabs.io
Tue Oct 22 09:52:48 CEST 2019


  Callbacks are called with the player locked, if the callback comes from Qt thread
  the signal emitted by Qt may be handled within the same thread directly and ask for
  the player lock again.
---
 modules/gui/qt/components/player_controller.cpp | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/modules/gui/qt/components/player_controller.cpp b/modules/gui/qt/components/player_controller.cpp
index 3bfafcc338..1b3b0d820a 100644
--- a/modules/gui/qt/components/player_controller.cpp
+++ b/modules/gui/qt/components/player_controller.cpp
@@ -239,7 +239,9 @@ static  void on_player_current_media_changed(vlc_player_t *, input_item_t *new_m
 
     if (!new_media)
     {
-        emit that->q_func()->inputChanged(false);
+        that->callAsync([that] () {
+            emit that->q_func()->inputChanged(false);
+        });
         return;
     }
 
@@ -721,7 +723,9 @@ static void on_player_media_epg_changed(vlc_player_t *, input_item_t *, void *da
 {
     PlayerControllerPrivate* that = static_cast<PlayerControllerPrivate*>(data);
     msg_Dbg( that->p_intf, "on_player_item_epg_changed");
-    emit that->q_func()->epgChanged();
+    that->callAsync([that] () {
+        emit that->q_func()->epgChanged();
+    });
 }
 
 static void on_player_subitems_changed(vlc_player_t *, input_item_t *, input_item_node_t *, void *data)
-- 
2.17.1



More information about the vlc-devel mailing list