[vlc-commits] access_jack: cleaning

Rémi Duraffort git at videolan.org
Sun Jul 14 12:04:09 CEST 2013


vlc/vlc-2.1 | branch: master | Rémi Duraffort <ivoire at videolan.org> | Sat Jul 13 19:30:01 2013 +0200| [8ecfd1e06eb4b7e361226b3fcf3952151ef23d5a] | committer: Jean-Baptiste Kempf

access_jack: cleaning

(cherry picked from commit db67442b62d640cdb29446649fc94cec1069da80)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/access/jack.c |   12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/modules/access/jack.c b/modules/access/jack.c
index b0e3026..12e0710 100644
--- a/modules/access/jack.c
+++ b/modules/access/jack.c
@@ -519,30 +519,24 @@ static void Port_finder( demux_t *p_demux )
         pp_jack_port_output = jack_get_ports( p_sys->p_jack_client,
            psz_uri, NULL, JackPortIsOutput );
         if( pp_jack_port_output == NULL )
-        {
             msg_Err( p_demux, "port(s) asked not found:%s", psz_uri );
-            free( pp_jack_port_output );
-        }
         else
         {
-            while( pp_jack_port_output && pp_jack_port_output[i_out_ports] )
-            {
+            while( pp_jack_port_output[i_out_ports] )
                 i_out_ports++;
-            }
             /* alloc an array to store all the matched ports */
             p_sys->pp_jack_port_table = xrealloc( p_sys->pp_jack_port_table,
                 (i_out_ports * sizeof( char * ) + i_total_out_ports * sizeof( char * ) ) );
 
             for(int i=0; i<i_out_ports;i++)
-            {
                 p_sys->pp_jack_port_table[i_total_out_ports+i] = ( char * ) pp_jack_port_output[i];
-            }
 
             i_total_out_ports += i_out_ports;
+
+            free( pp_jack_port_output );
         }
     }
 
-    free( pp_jack_port_output );
     p_sys->i_match_ports = i_total_out_ports;
 }
 



More information about the vlc-commits mailing list