[vlc-devel] commit: visual: avoid a strdup/free. ( Rémi Duraffort )

git version control git at videolan.org
Wed Mar 25 14:30:59 CET 2009


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Wed Mar 25 14:21:50 2009 +0100| [a1358b0ceedcd0abb1bc14fc8d3d2ae329c39fcf] | committer: Rémi Duraffort 

visual: avoid a strdup/free.

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

 modules/visualization/visual/visual.c |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)

diff --git a/modules/visualization/visual/visual.c b/modules/visualization/visual/visual.c
index 857d33a..3ee95a8 100644
--- a/modules/visualization/visual/visual.c
+++ b/modules/visualization/visual/visual.c
@@ -189,12 +189,10 @@ static int Open( vlc_object_t *p_this )
 {
     aout_filter_t     *p_filter = (aout_filter_t *)p_this;
     aout_filter_sys_t *p_sys;
-    vlc_value_t        val;
 
     char *psz_effects, *psz_parser;
     video_format_t fmt;
 
-
     if( ( p_filter->input.i_format != VLC_FOURCC('f','l','3','2') &&
           p_filter->input.i_format != VLC_FOURCC('f','i','3','2') ) )
     {
@@ -217,11 +215,7 @@ static int Open( vlc_object_t *p_this )
     p_sys->effect   = NULL;
 
     /* Parse the effect list */
-    var_Create( p_filter, "effect-list", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
-    var_Get( p_filter, "effect-list", &val);
-    psz_parser = psz_effects = strdup( val.psz_string );
-    free( val.psz_string );
-
+    psz_parser = psz_effects = var_CreateGetString( p_filter, "effect-list" );
     var_AddCallback( p_filter, "effect-list", FilterCallback, NULL );
 
     while( psz_parser && *psz_parser != '\0' )




More information about the vlc-devel mailing list