[vlc-commits] vout: small simplification

Rémi Denis-Courmont git at videolan.org
Wed May 1 11:08:53 CEST 2013


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed May  1 11:22:30 2013 +0300| [e5951eb37ac372539154b60fc70540b59e2f24c6] | committer: Rémi Denis-Courmont

vout: small simplification

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

 src/video_output/vout_intf.c |   16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/src/video_output/vout_intf.c b/src/video_output/vout_intf.c
index 9924a6b..e995c3a 100644
--- a/src/video_output/vout_intf.c
+++ b/src/video_output/vout_intf.c
@@ -236,10 +236,12 @@ void vout_IntfInit( vout_thread_t *p_vout )
     }
 
     var_AddCallback( p_vout, "crop", CropCallback, NULL );
-    var_Get( p_vout, "crop", &old_val );
-    if( old_val.psz_string && *old_val.psz_string )
+    psz_buf = var_GetNonEmptyString( p_vout, "crop" );
+    if( psz_buf != NULL )
+    {
         var_TriggerCallback( p_vout, "crop" );
-    free( old_val.psz_string );
+        free( psz_buf );
+    }
 
     /* Monitor pixel aspect-ratio */
     var_Create( p_vout, "monitor-par", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
@@ -270,10 +272,12 @@ void vout_IntfInit( vout_thread_t *p_vout )
     }
 
     var_AddCallback( p_vout, "aspect-ratio", AspectCallback, NULL );
-    var_Get( p_vout, "aspect-ratio", &old_val );
-    if( (old_val.psz_string && *old_val.psz_string) )
+    psz_buf = var_GetNonEmptyString( p_vout, "aspect-ratio" );
+    if( psz_buf != NULL )
+    {
         var_TriggerCallback( p_vout, "aspect-ratio" );
-    free( old_val.psz_string );
+        free( psz_buf );
+    }
 
     /* Add a variable to indicate if the window should be on top of others */
     var_Create( p_vout, "video-on-top", VLC_VAR_BOOL | VLC_VAR_DOINHERIT



More information about the vlc-commits mailing list