[vlc-devel] [PATCH v2] vout: fix fullscreen race condition

Romain Vimont rom1v at videolabs.io
Wed Apr 18 09:51:51 CEST 2018

There are at least two VLC variables "fullscreen", associated to
different vlc objects: the playlist and the vout. If fullscreen is
toggled while vout is not initialized yet, the vout misses the toggle.

To avoid the issue, on vout list changes, copy the "fullscreen" variable
from the playlist to the vout.

== Race condition details ==

The vout is initially created by the call to
input_resource_RequestVout() in decoder.c:vout_update_format(). During
this creation, the vout variable "fullscreen" is created with the value
inherited from the playlist variable (in vout_intf.c:vout_IntfInit()).

Only then, INPUT_EVENT_VOUT is triggered by input_SendEventVout(),
leading to initialize the p_vout variable in hotkeys.c:ChangeVout().
Before it is initialized, ACTION_IDTOGGLE_FULLSCREEN events are ignored.

Therefore, if fullscreen is toggled after the vout variable "fullscreen"
is created but before INPUT_EVENT_VOUT is handled, then the toggle is
not applied to the vout, while it is applied to the playlist (and the

Fixes #19697
 modules/gui/qt/components/controller.cpp | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/modules/gui/qt/components/controller.cpp b/modules/gui/qt/components/controller.cpp
index e10b1e4208..3b4e3bbd66 100644
--- a/modules/gui/qt/components/controller.cpp
+++ b/modules/gui/qt/components/controller.cpp
@@ -1209,9 +1209,7 @@ void FullscreenControllerWidget::setVoutList( vout_thread_t **pp_vout, int i_vou
         vout.append( p_vout );
         var_AddCallback( p_vout, "fullscreen",
                          FullscreenControllerWidget::FullscreenChanged, this );
-        /* I miss a add and fire */
-        emit fullscreenChanged( p_vout, var_InheritBool( THEPL, "fullscreen" ),
-                           var_GetInteger( p_vout, "mouse-hide-timeout" ) );
+        var_SetBool( p_vout, "fullscreen", var_InheritBool( THEPL, "fullscreen" ) );
         vlc_mutex_unlock( &lock );

More information about the vlc-devel mailing list