[vlc-commits] Cosmetics

Rémi Duraffort git at videolan.org
Thu Jan 20 21:03:27 CET 2011


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Thu Jan 20 20:52:18 2011 +0100| [c495c265de8ee928e99fb78a61ff1161be126e94] | committer: Rémi Duraffort

Cosmetics

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

 modules/stream_out/delay.c        |   17 +++++++----------
 modules/stream_out/langfromtelx.c |    9 ++++-----
 modules/stream_out/setid.c        |    9 ++++-----
 3 files changed, 15 insertions(+), 20 deletions(-)

diff --git a/modules/stream_out/delay.c b/modules/stream_out/delay.c
index 32220cc..919163f 100644
--- a/modules/stream_out/delay.c
+++ b/modules/stream_out/delay.c
@@ -91,26 +91,23 @@ static int Open( vlc_object_t *p_this )
 {
     sout_stream_t     *p_stream = (sout_stream_t*)p_this;
     sout_stream_sys_t *p_sys;
-    vlc_value_t       val;
-
-    p_sys          = calloc( 1, sizeof( sout_stream_sys_t ) );
-    if( !p_sys )
-        return VLC_ENOMEM;
 
     if( !p_stream->p_next )
     {
         msg_Err( p_stream, "cannot create chain" );
-        free( p_sys );
         return VLC_EGENERIC;
     }
 
+    p_sys = calloc( 1, sizeof( sout_stream_sys_t ) );
+    if( !p_sys )
+        return VLC_ENOMEM;
+
+
     config_ChainParse( p_stream, SOUT_CFG_PREFIX, ppsz_sout_options,
                    p_stream->p_cfg );
 
-    var_Get( p_stream, SOUT_CFG_PREFIX "id", &val );
-    p_sys->i_id = val.i_int;
-    var_Get( p_stream, SOUT_CFG_PREFIX "delay", &val );
-    p_sys->i_delay = val.i_int * 1000;
+    p_sys->i_id = var_GetInteger( p_stream, SOUT_CFG_PREFIX "id" );
+    p_sys->i_delay = 1000 * var_GetInteger( p_stream, SOUT_CFG_PREFIX "delay" );
 
     p_stream->pf_add    = Add;
     p_stream->pf_del    = Del;
diff --git a/modules/stream_out/langfromtelx.c b/modules/stream_out/langfromtelx.c
index 72394d3..5173779 100644
--- a/modules/stream_out/langfromtelx.c
+++ b/modules/stream_out/langfromtelx.c
@@ -105,17 +105,16 @@ static int Open( vlc_object_t *p_this )
     sout_stream_t     *p_stream = (sout_stream_t*)p_this;
     sout_stream_sys_t *p_sys;
 
-    p_sys = malloc( sizeof( sout_stream_sys_t ) );
-    if( unlikely( !p_sys ) )
-        return VLC_ENOMEM;
-
     if( !p_stream->p_next )
     {
         msg_Err( p_stream, "cannot create chain" );
-        free( p_sys );
         return VLC_EGENERIC;
     }
 
+    p_sys = malloc( sizeof( sout_stream_sys_t ) );
+    if( unlikely( !p_sys ) )
+        return VLC_ENOMEM;
+
     config_ChainParse( p_stream, SOUT_CFG_PREFIX, ppsz_sout_options,
                        p_stream->p_cfg );
 
diff --git a/modules/stream_out/setid.c b/modules/stream_out/setid.c
index a2d8d4a..f2e23ae 100644
--- a/modules/stream_out/setid.c
+++ b/modules/stream_out/setid.c
@@ -116,17 +116,16 @@ static int OpenCommon( vlc_object_t *p_this )
     sout_stream_t     *p_stream = (sout_stream_t*)p_this;
     sout_stream_sys_t *p_sys;
 
-    p_sys = malloc( sizeof( sout_stream_sys_t ) );
-    if( unlikely( !p_sys ) )
-        return VLC_ENOMEM;
-
     if( !p_stream->p_next )
     {
         msg_Err( p_stream, "cannot create chain" );
-        free( p_sys );
         return VLC_EGENERIC;
     }
 
+    p_sys = malloc( sizeof( sout_stream_sys_t ) );
+    if( unlikely( !p_sys ) )
+        return VLC_ENOMEM;
+
     p_stream->pf_del    = Del;
     p_stream->pf_send   = Send;
 



More information about the vlc-commits mailing list