[vlc-commits] audiobargraph_v: simplify Open

Rafaël Carré git at videolan.org
Wed Apr 16 22:32:49 CEST 2014


vlc | branch: master | Rafaël Carré <funman at videolan.org> | Wed Apr 16 16:08:57 2014 +0200| [53d10bb5b5d1189fb77f8afdda9b7399026d8c23] | committer: Rafaël Carré

audiobargraph_v: simplify Open

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=53d10bb5b5d1189fb77f8afdda9b7399026d8c23
---

 modules/video_filter/audiobargraph_v.c |   16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)

diff --git a/modules/video_filter/audiobargraph_v.c b/modules/video_filter/audiobargraph_v.c
index e56e182..39ed6c1 100644
--- a/modules/video_filter/audiobargraph_v.c
+++ b/modules/video_filter/audiobargraph_v.c
@@ -805,8 +805,6 @@ static int OpenCommon( vlc_object_t *p_this, bool b_sub )
 {
     filter_t *p_filter = (filter_t *)p_this;
     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 ) )
@@ -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 ) );
     if( !p_sys )
         return VLC_ENOMEM;
-    p_BarGraph = &(p_sys->p_BarGraph);
-    p_BarGraph->p_pic = NULL;
 
     /* */
     p_sys->p_blend = NULL;
     if( !b_sub )
     {
-
         p_sys->p_blend = filter_NewBlend( VLC_OBJECT(p_filter),
                                           &p_filter->fmt_in.video );
         if( !p_sys->p_blend )
         {
-            //free( p_BarGraph );
             free( p_sys );
             return VLC_EGENERIC;
         }
@@ -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_x = var_CreateGetIntegerCommand( p_filter, "audiobargraph_v-x" );
     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,
                                                         "audiobargraph_v-transparency" );
     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 });
     p_BarGraph->alarm = false;
 
@@ -878,17 +872,11 @@ static int OpenCommon( vlc_object_t *p_this, bool b_sub )
         var_AddCallback( p_filter, ppsz_filter_callbacks[i],
                          BarGraphCallback, p_sys );
 
-    /* Misc init */
     if( b_sub )
-    {
         p_filter->pf_sub_source = FilterSub;
-    }
     else
-    {
         p_filter->pf_video_filter = FilterVideo;
-    }
 
-    free( i_values );
     return VLC_SUCCESS;
 }
 



More information about the vlc-commits mailing list