| 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 ); |
|---|