Commit cc4f67fe authored by Laurent Aimar's avatar Laurent Aimar
Browse files

Do not access vout_thread_t fields when it can be avoided.

parent fd584ea3
......@@ -157,7 +157,7 @@ void CloseIntf ( decoder_sys_t *p_intf )
if( p_vout )
{
/* enable CMML as a subtitle track */
spu_Control( p_vout->p_spu, SPU_CHANNEL_CLEAR, DEFAULT_CHAN );
spu_Control( vout_GetSpu( p_vout ), SPU_CHANNEL_CLEAR, DEFAULT_CHAN );
vlc_object_release( p_vout );
}
......
......@@ -197,7 +197,7 @@ static void Run( intf_thread_t *p_intf )
int i;
for( i = 0; i < CHANNELS_NUMBER; i++ )
{
spu_Control( p_vout->p_spu, SPU_CHANNEL_REGISTER,
spu_Control( vout_GetSpu( p_vout ), SPU_CHANNEL_REGISTER,
&p_intf->p_sys->p_channels[ i ] );
}
}
......@@ -1068,7 +1068,7 @@ static void DisplayPosition( intf_thread_t *p_intf, vout_thread_t *p_vout,
vout_OSDMessage( p_input, POSITION_TEXT_CHAN, "%s", psz_time );
}
if( p_vout->b_fullscreen )
if( var_GetBool( p_vout, "fullscreen" ) )
{
var_Get( p_input, "position", &pos );
vout_OSDSlider( VLC_OBJECT( p_input ), POSITION_WIDGET_CHAN,
......@@ -1085,7 +1085,7 @@ static void DisplayVolume( intf_thread_t *p_intf, vout_thread_t *p_vout,
}
ClearChannels( p_intf, p_vout );
if( p_vout->b_fullscreen )
if( var_GetBool( p_vout, "fullscreen" ) )
{
vout_OSDSlider( VLC_OBJECT( p_vout ), VOLUME_WIDGET_CHAN,
i_vol*100/AOUT_VOLUME_MAX, OSD_VERT_SLIDER );
......@@ -1103,10 +1103,11 @@ static void ClearChannels( intf_thread_t *p_intf, vout_thread_t *p_vout )
if( p_vout )
{
spu_Control( p_vout->p_spu, SPU_CHANNEL_CLEAR, DEFAULT_CHAN );
spu_t *p_spu = vout_GetSpu( p_vout );
spu_Control( p_spu, SPU_CHANNEL_CLEAR, DEFAULT_CHAN );
for( i = 0; i < CHANNELS_NUMBER; i++ )
{
spu_Control( p_vout->p_spu, SPU_CHANNEL_CLEAR,
spu_Control( p_spu, SPU_CHANNEL_CLEAR,
p_intf->p_sys->p_channels[ i ] );
}
}
......
......@@ -235,7 +235,7 @@ static void MacroDo( httpd_file_sys_t *p_args,
p_vout = input_GetVout( p_sys->p_input );
if( p_vout )
{
p_vout->i_changes |= VOUT_FULLSCREEN_CHANGE;
var_SetBool( p_vout, "fullscreen", !var_GetBool( p_vout, "fullscreen" ) );
vlc_object_release( p_vout );
msg_Dbg( p_intf, "requested fullscreen toggle" );
}
......
......@@ -347,7 +347,7 @@ void ExtVideo::ChangeVFiltersString( const char *psz_name, bool b_add )
if( p_vout )
{
if( !strcmp( psz_filter_type, "sub-filter" ) )
var_SetString( p_vout->p_spu, psz_filter_type, psz_string );
var_SetString( vout_GetSpu( p_vout ), psz_filter_type, psz_string );
else
var_SetString( p_vout, psz_filter_type, psz_string );
vlc_object_release( p_vout );
......
......@@ -37,7 +37,7 @@ void CmdFullscreen::execute()
if( pVout )
{
// Switch to fullscreen
pVout->i_changes |= VOUT_FULLSCREEN_CHANGE;
var_SetBool( pVout, "fullscreen", !var_GetBool( pVout, "fullscreen" ) );
vlc_object_release( pVout );
}
}
......@@ -344,7 +344,7 @@ void VlcProc::refreshInput()
pVarHasVout->set( pVout != NULL );
if( pVout )
{
pVarFullscreen->set( pVout->b_fullscreen );
pVarFullscreen->set( var_GetBool( pVout, "fullscreen" ) );
vlc_object_release( pVout );
}
......
......@@ -134,7 +134,7 @@ static int vlclua_spu_channel_register( lua_State *L )
if( !p_vout )
return luaL_error( L, "Unable to find vout." );
spu_Control( p_vout->p_spu, SPU_CHANNEL_REGISTER, &i_chan );
spu_Control( vout_GetSpu( p_vout ), SPU_CHANNEL_REGISTER, &i_chan );
vlc_object_release( p_vout );
lua_pushinteger( L, i_chan );
return 1;
......@@ -149,7 +149,7 @@ static int vlclua_spu_channel_clear( lua_State *L )
if( !p_vout )
return luaL_error( L, "Unable to find vout." );
spu_Control( p_vout->p_spu, SPU_CHANNEL_CLEAR, i_chan );
spu_Control( vout_GetSpu( p_vout ), SPU_CHANNEL_CLEAR, i_chan );
vlc_object_release( p_vout );
return 0;
}
......
......@@ -118,7 +118,7 @@ int mediacontrol_showtext( vout_thread_t *p_vout, int i_channel,
int i_flags, int i_hmargin, int i_vmargin,
mtime_t i_start, mtime_t i_stop )
{
return osd_ShowTextAbsolute( p_vout->p_spu, i_channel,
return osd_ShowTextAbsolute( vout_GetSpu( p_vout ), i_channel,
psz_string, p_style,
i_flags, i_hmargin, i_vmargin,
i_start, i_stop );
......
......@@ -1536,7 +1536,7 @@ static void DecoderPlaySpu( decoder_t *p_dec, subpicture_t *p_subpic,
vlc_mutex_unlock( &p_owner->lock );
if( !b_reject )
spu_DisplaySubpicture( p_vout->p_spu, p_subpic );
spu_DisplaySubpicture( vout_GetSpu( p_vout ), p_subpic );
else
subpicture_Delete( p_subpic );
......@@ -1877,7 +1877,7 @@ static void DecoderProcessSpu( decoder_t *p_dec, block_t *p_block, bool b_flush
p_vout = input_resource_HoldVout( p_input->p->p_resource );
if( p_vout && p_owner->p_spu_vout == p_vout )
spu_Control( p_vout->p_spu, SPU_CHANNEL_CLEAR,
spu_Control( vout_GetSpu( p_vout ), SPU_CHANNEL_CLEAR,
p_owner->i_spu_channel );
if( p_vout )
......@@ -2042,7 +2042,7 @@ static void DeleteDecoder( decoder_t * p_dec )
if( p_vout )
{
if( p_owner->p_spu_vout == p_vout )
spu_Control( p_vout->p_spu, SPU_CHANNEL_CLEAR, p_owner->i_spu_channel );
spu_Control( vout_GetSpu( p_vout ), SPU_CHANNEL_CLEAR, p_owner->i_spu_channel );
vlc_object_release( p_vout );
}
}
......@@ -2390,7 +2390,7 @@ static subpicture_t *spu_new_buffer( decoder_t *p_dec )
vlc_mutex_unlock( &p_owner->lock );
spu_Control( p_vout->p_spu, SPU_CHANNEL_REGISTER,
spu_Control( vout_GetSpu( p_vout ), SPU_CHANNEL_REGISTER,
&p_owner->i_spu_channel );
p_owner->i_spu_order = 0;
p_owner->p_spu_vout = p_vout;
......
......@@ -262,7 +262,7 @@ static vout_thread_t *RequestVout( input_resource_t *p_resource,
{
msg_Dbg( p_resource->p_input, "saving a free vout" );
vout_Flush( p_vout, 1 );
spu_Control( p_vout->p_spu, SPU_CHANNEL_CLEAR, -1 );
spu_Control( vout_GetSpu( p_vout ), SPU_CHANNEL_CLEAR, -1 );
p_resource->p_vout_free = p_vout;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment