summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
ec10498)
The old video output core assumes that the fullscreen state must be
toggled if the VOUT_FULLSCREEN_CHANGE bit is set. So we need to check
that the target state is not already correct, as the VLC variables core
does NOT do it internally. This commit provides rare exception to the
rule that oldval is useless.
This fixes a whole class of race conditions where two threads try to
change fullscreen status at the same time.
In the video filter case, we now enable fullscreen on all childrens, not
just one. This seems a bit more logical for wall. Without this, toggling
fullscreen would only ever work on the first video output. With this,
things should work great if the different pieces of the wall are on
different video ports, and OK (Alt+Tab is your friend) otherwise.
}
case ACTIONID_LEAVE_FULLSCREEN:
}
case ACTIONID_LEAVE_FULLSCREEN:
- if( p_vout && var_GetBool( p_vout, "fullscreen" ) )
var_SetBool( p_vout, "fullscreen", false );
break;
var_SetBool( p_vout, "fullscreen", false );
break;
return var_Set( p_dst, psz_var, newval );
}
return var_Set( p_dst, psz_var, newval );
}
-/**
- * Internal helper to forward fullscreen event from p_this to p_data.
- */
-static inline int ForwardFullscreen( vlc_object_t *p_this, char const *psz_var,
- vlc_value_t oldval, vlc_value_t newval, void *p_data )
-{
- VLC_UNUSED(p_this); VLC_UNUSED(oldval);
- vlc_object_t *p_dst = (vlc_object_t*)p_data;
-
- if( !var_GetBool( p_dst, "fullscreen" ) != !newval.b_bool )
- return var_SetBool( p_dst, psz_var, newval.b_bool );
- return VLC_SUCCESS;
-}
/**
* Install/remove all callbacks needed for proper event handling inside
* a vout-filter.
/**
* Install/remove all callbacks needed for proper event handling inside
* a vout-filter.
/* */
if( !pf_fullscreen_up )
/* */
if( !pf_fullscreen_up )
- pf_fullscreen_up = ForwardFullscreen;
+ pf_fullscreen_up = ForwardEvent;
if( !pf_fullscreen_down )
if( !pf_fullscreen_down )
- pf_fullscreen_down = ForwardFullscreen;
+ pf_fullscreen_down = ForwardEvent;
pf_execute( VLC_OBJECT(p_child), "fullscreen", pf_fullscreen_up, p_parent );
pf_execute( VLC_OBJECT(p_parent), "fullscreen", pf_fullscreen_down, p_child );
}
pf_execute( VLC_OBJECT(p_child), "fullscreen", pf_fullscreen_up, p_parent );
pf_execute( VLC_OBJECT(p_parent), "fullscreen", pf_fullscreen_down, p_child );
}
VLC_UNUSED(oldval); VLC_UNUSED(p_this); VLC_UNUSED(psz_var); VLC_UNUSED(newval);
const bool b_fullscreen = IsFullscreenActive( p_vout );
VLC_UNUSED(oldval); VLC_UNUSED(p_this); VLC_UNUSED(psz_var); VLC_UNUSED(newval);
const bool b_fullscreen = IsFullscreenActive( p_vout );
- if( !var_GetBool( p_vout, "fullscreen" ) != !b_fullscreen )
- return var_SetBool( p_vout, "fullscreen", b_fullscreen );
- return VLC_SUCCESS;
+ return var_SetBool( p_vout, "fullscreen", b_fullscreen );
}
static int FullscreenEventDown( vlc_object_t *p_this, char const *psz_var,
vlc_value_t oldval, vlc_value_t newval, void *p_data )
}
static int FullscreenEventDown( vlc_object_t *p_this, char const *psz_var,
vlc_value_t oldval, vlc_value_t newval, void *p_data )
vout_sys_t *p_sys = p_vout->p_sys;
VLC_UNUSED(oldval); VLC_UNUSED(p_data); VLC_UNUSED(psz_var);
vout_sys_t *p_sys = p_vout->p_sys;
VLC_UNUSED(oldval); VLC_UNUSED(p_data); VLC_UNUSED(psz_var);
- const bool b_fullscreen = IsFullscreenActive( p_vout );
- if( !b_fullscreen != !newval.b_bool )
+ for( int i = 0; i < p_sys->i_vout; i++ )
- for( int i = 0; i < p_sys->i_vout; i++ )
- {
- vout_thread_t *p_child = p_sys->pp_vout[i];
- if( !var_GetBool( p_child, "fullscreen" ) != !newval.b_bool )
- {
- var_SetBool( p_child, "fullscreen", newval.b_bool );
- if( newval.b_bool )
- return VLC_SUCCESS;
- }
- }
+ vout_thread_t *p_child = p_sys->pp_vout[i];
+ var_SetBool( p_child, "fullscreen", newval.b_bool );
static inline void vout_SendEventFullscreen(vout_thread_t *vout, bool is_fullscreen)
{
static inline void vout_SendEventFullscreen(vout_thread_t *vout, bool is_fullscreen)
{
- if (!var_GetBool(vout, "fullscreen") != !is_fullscreen)
- var_SetBool(vout, "fullscreen", is_fullscreen);
+ var_SetBool(vout, "fullscreen", is_fullscreen);
}
static inline void vout_SendEventDisplayFilled(vout_thread_t *vout, bool is_display_filled)
}
static inline void vout_SendEventDisplayFilled(vout_thread_t *vout, bool is_display_filled)
{
vout_thread_t *p_vout = (vout_thread_t *)p_this;
vlc_value_t val;
{
vout_thread_t *p_vout = (vout_thread_t *)p_this;
vlc_value_t val;
- (void)psz_cmd; (void)oldval; (void)p_data;
+ (void)psz_cmd; (void)p_data;
+ if( oldval.b_bool == newval.b_bool )
+ return VLC_SUCCESS; /* no-op */
p_vout->i_changes |= VOUT_FULLSCREEN_CHANGE;
/* Modify libvlc as well because the vout might have to be restarted */
p_vout->i_changes |= VOUT_FULLSCREEN_CHANGE;
/* Modify libvlc as well because the vout might have to be restarted */