[vlc-commits] qt: force signals from the player callbacks to be emmited from a queued connection.

Pierre Lamot git at videolan.org
Thu Oct 31 01:02:16 CET 2019


vlc | branch: master | Pierre Lamot <pierre at videolabs.io> | Mon Oct 21 17:44:20 2019 +0200| [acbfcdd54e02c45e66edbdbd3c6c21c528edff35] | committer: Jean-Baptiste Kempf

qt: force signals from the player callbacks to be emmited from a queued connection.

callbacks are called with the player locked, if the callback commes from Qt thread,
  the signal emitted by Qt may be handled within the same thread directly and ask for
  the player lock again.

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

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

 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)



More information about the vlc-commits mailing list