Commit 53d10bb5 authored by Rafaël Carré's avatar Rafaël Carré

audiobargraph_v: simplify Open

parent e584696c
...@@ -805,8 +805,6 @@ static int OpenCommon( vlc_object_t *p_this, bool b_sub ) ...@@ -805,8 +805,6 @@ static int OpenCommon( vlc_object_t *p_this, bool b_sub )
{ {
filter_t *p_filter = (filter_t *)p_this; filter_t *p_filter = (filter_t *)p_this;
filter_sys_t *p_sys; filter_sys_t *p_sys;
BarGraph_t *p_BarGraph;
char* i_values = NULL;
/* */ /* */
if( !b_sub && !es_format_IsSimilar( &p_filter->fmt_in, &p_filter->fmt_out ) ) if( !b_sub && !es_format_IsSimilar( &p_filter->fmt_in, &p_filter->fmt_out ) )
...@@ -820,19 +818,15 @@ static int OpenCommon( vlc_object_t *p_this, bool b_sub ) ...@@ -820,19 +818,15 @@ static int OpenCommon( vlc_object_t *p_this, bool b_sub )
p_filter->p_sys = p_sys = malloc( sizeof( *p_sys ) ); p_filter->p_sys = p_sys = malloc( sizeof( *p_sys ) );
if( !p_sys ) if( !p_sys )
return VLC_ENOMEM; return VLC_ENOMEM;
p_BarGraph = &(p_sys->p_BarGraph);
p_BarGraph->p_pic = NULL;
/* */ /* */
p_sys->p_blend = NULL; p_sys->p_blend = NULL;
if( !b_sub ) if( !b_sub )
{ {
p_sys->p_blend = filter_NewBlend( VLC_OBJECT(p_filter), p_sys->p_blend = filter_NewBlend( VLC_OBJECT(p_filter),
&p_filter->fmt_in.video ); &p_filter->fmt_in.video );
if( !p_sys->p_blend ) if( !p_sys->p_blend )
{ {
//free( p_BarGraph );
free( p_sys ); free( p_sys );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
...@@ -846,11 +840,11 @@ static int OpenCommon( vlc_object_t *p_this, bool b_sub ) ...@@ -846,11 +840,11 @@ static int OpenCommon( vlc_object_t *p_this, bool b_sub )
p_sys->i_pos = var_CreateGetIntegerCommand( p_filter, "audiobargraph_v-position" ); p_sys->i_pos = var_CreateGetIntegerCommand( p_filter, "audiobargraph_v-position" );
p_sys->i_pos_x = var_CreateGetIntegerCommand( p_filter, "audiobargraph_v-x" ); p_sys->i_pos_x = var_CreateGetIntegerCommand( p_filter, "audiobargraph_v-x" );
p_sys->i_pos_y = var_CreateGetIntegerCommand( p_filter, "audiobargraph_v-y" ); p_sys->i_pos_y = var_CreateGetIntegerCommand( p_filter, "audiobargraph_v-y" );
BarGraph_t *p_BarGraph = &p_sys->p_BarGraph;
p_BarGraph->p_pic = NULL;
p_BarGraph->i_alpha = var_CreateGetIntegerCommand( p_filter, p_BarGraph->i_alpha = var_CreateGetIntegerCommand( p_filter,
"audiobargraph_v-transparency" ); "audiobargraph_v-transparency" );
p_BarGraph->i_alpha = VLC_CLIP( p_BarGraph->i_alpha, 0, 255 ); p_BarGraph->i_alpha = VLC_CLIP( p_BarGraph->i_alpha, 0, 255 );
//p_BarGraph->nbChannels = 0;
//p_BarGraph->i_values = NULL;
parse_i_values(p_BarGraph, &(char){ 0 }); parse_i_values(p_BarGraph, &(char){ 0 });
p_BarGraph->alarm = false; p_BarGraph->alarm = false;
...@@ -878,17 +872,11 @@ static int OpenCommon( vlc_object_t *p_this, bool b_sub ) ...@@ -878,17 +872,11 @@ static int OpenCommon( vlc_object_t *p_this, bool b_sub )
var_AddCallback( p_filter, ppsz_filter_callbacks[i], var_AddCallback( p_filter, ppsz_filter_callbacks[i],
BarGraphCallback, p_sys ); BarGraphCallback, p_sys );
/* Misc init */
if( b_sub ) if( b_sub )
{
p_filter->pf_sub_source = FilterSub; p_filter->pf_sub_source = FilterSub;
}
else else
{
p_filter->pf_video_filter = FilterVideo; p_filter->pf_video_filter = FilterVideo;
}
free( i_values );
return VLC_SUCCESS; return VLC_SUCCESS;
} }
......
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