Changeset 2c7efa6aff2a5fc42599e8b94a47615e8b99f04b

Show
Ignore:
Timestamp:
22/08/07 00:37:49 (1 year ago)
Author:
Rafaël Carré <funman@videolan.org>
git-committer:
Rafaël Carré <funman@videolan.org> 1187735869 +0000
git-parent:

[f88235c4f19e811edf793ac2dfc89959b4b41e04]

git-author:
Rafaël Carré <funman@videolan.org> 1187735869 +0000
Message:

Correctly handle (avoid deadlocks) always on top when switching fullscreen.
Fixes #882

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/video_output/x11/xcommon.c

    re40d134 r2c7efa6  
    14461446    if ( p_vout->i_changes & VOUT_FULLSCREEN_CHANGE ) 
    14471447    { 
    1448         vlc_value_t val
     1448        vlc_value_t val_fs, val_ontop
    14491449 
    14501450        /* Update the object variable and trigger callback */ 
    1451         val.b_bool = !p_vout->b_fullscreen; 
    1452  
    1453         /* 
    1454          * FIXME FIXME FIXME FIXME: EXPLICIT HACK. 
    1455          * On the one hand, we cannot hold the lock while triggering a 
    1456          * callback, as it causes a deadlock with video-on-top handling. 
    1457          * On the other hand, we have to lock while triggering the 
    1458          * callback to: 
    1459          *  1/ make sure video-on-top remains in sync with fullscreen 
    1460          *    (i.e. unlocking creates a race condition if fullscreen is 
    1461          *     switched on and off VERY FAST). 
    1462          *  2/ avoid possible corruption bugs if another thread gets the 
    1463          *     mutex and modifies our data in-between. 
    1464          * 
    1465          * This is obviously contradictory. Correct solutions may include: 
    1466          *  - putting the fullscreen NAND video-on-top logic out of libvlc, 
    1467          *    back into the video output plugins (ugly code duplication...), 
    1468          *  - serializing fullscreen and video-on-top handling properly 
    1469          *    instead of doing it via the fullscreen callback. That's got to 
    1470          *    be the correct one. 
    1471          */ 
    1472 #ifdef MODULE_NAME_IS_xvmc 
    1473         xvmc_context_reader_unlock( &p_vout->p_sys->xvmc_lock ); 
    1474 #endif 
    1475         vlc_mutex_unlock( &p_vout->p_sys->lock ); 
    1476  
    1477         var_Set( p_vout, "fullscreen", val ); 
    1478  
    1479         vlc_mutex_lock( &p_vout->p_sys->lock ); 
    1480 #ifdef MODULE_NAME_IS_xvmc 
    1481         xvmc_context_reader_lock( &p_vout->p_sys->xvmc_lock ); 
    1482 #endif 
     1451        val_fs.b_bool = !p_vout->b_fullscreen; 
     1452 
     1453        var_Set( p_vout, "fullscreen", val_fs ); 
     1454 
     1455        /* Disable "always on top" in fullscreen mode */ 
     1456        var_Get( p_vout, "video-on-top", &val_ontop ); 
     1457        if( val_ontop.b_bool ) 
     1458            WindowOnTop( p_vout, val_fs.b_bool ); 
    14831459 
    14841460        ToggleFullScreen( p_vout ); 
  • src/video_output/vout_intf.c

    r8820f0c r2c7efa6  
    11591159    pl_Release( p_playlist ); 
    11601160 
    1161     /* Disable "always on top" in fullscreen mode */ 
    1162     var_Get( p_vout, "video-on-top", &val ); 
    1163     if( val.b_bool ) 
    1164         vout_Control( p_vout, VOUT_SET_STAY_ON_TOP, 
    1165                       (vlc_bool_t)!newval.b_bool ); 
    1166  
    11671161    val.b_bool = VLC_TRUE; 
    11681162    var_Set( p_vout, "intf-change", val );