get vout: use size_t for the counter
authorRémi Denis-Courmont <remi@remlab.net>
Sat, 15 Aug 2009 14:08:41 +0000 (17:08 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Sat, 15 Aug 2009 14:08:41 +0000 (17:08 +0300)
Internal counter is still int due to tab macros.

include/vlc_input.h
src/input/control.c
src/input/resource.c
src/input/resource.h

index 561a753..d6048f5 100644 (file)
@@ -568,12 +568,12 @@ static inline int input_AddSubtitle( input_thread_t *p_input, const char *psz_ur
 static inline vout_thread_t *input_GetVout( input_thread_t *p_input )
 {
      vout_thread_t **pp_vout, *p_vout;
-     unsigned i_vout;
+     size_t i_vout;
 
      if( input_Control( p_input, INPUT_GET_VOUTS, &pp_vout, &i_vout ) )
          return NULL;
 
-     for( unsigned i = 1; i < i_vout; i++ )
+     for( size_t i = 1; i < i_vout; i++ )
          vlc_object_release( (vlc_object_t *)(pp_vout[i]) );
 
      p_vout = (i_vout >= 1) ? pp_vout[0] : NULL;
index 450905b..826f096 100644 (file)
@@ -427,7 +427,7 @@ int input_vaControl( input_thread_t *p_input, int i_query, va_list args )
         case INPUT_GET_VOUTS:
         {
             vout_thread_t ***ppp_vout = (vout_thread_t***)va_arg( args, vout_thread_t*** );
-            int           *pi_vout = (int*)va_arg( args, int* );
+            size_t        *pi_vout = va_arg( args, size_t * );
 
             input_resource_HoldVouts( p_input->p->p_resource, ppp_vout, pi_vout );
             if( *pi_vout <= 0 )
index 9132bf6..7b9b1f3 100644 (file)
@@ -288,7 +288,9 @@ static vout_thread_t *HoldVout( input_resource_t *p_resource )
 
     return p_vout;
 }
-static void HoldVouts( input_resource_t *p_resource, vout_thread_t ***ppp_vout, int *pi_vout )
+
+static void HoldVouts( input_resource_t *p_resource, vout_thread_t ***ppp_vout,
+                       size_t *pi_vout )
 {
     vout_thread_t **pp_vout;
 
@@ -300,7 +302,7 @@ static void HoldVouts( input_resource_t *p_resource, vout_thread_t ***ppp_vout,
     if( p_resource->i_vout <= 0 )
         goto exit;
 
-    pp_vout = calloc( p_resource->i_vout, sizeof(*pp_vout) );
+    pp_vout = malloc( p_resource->i_vout * sizeof(*pp_vout) );
     if( !pp_vout )
         goto exit;
 
@@ -460,10 +462,13 @@ vout_thread_t *input_resource_HoldVout( input_resource_t *p_resource )
 {
     return HoldVout( p_resource );
 }
-void input_resource_HoldVouts( input_resource_t *p_resource, vout_thread_t ***ppp_vout, int *pi_vout )
+
+void input_resource_HoldVouts( input_resource_t *p_resource, vout_thread_t ***ppp_vout,
+                               size_t *pi_vout )
 {
     HoldVouts( p_resource, ppp_vout, pi_vout );
 }
+
 void input_resource_TerminateVout( input_resource_t *p_resource )
 {
     input_resource_RequestVout( p_resource, NULL, NULL, false );
index 15bc377..fa20611 100644 (file)
@@ -81,7 +81,7 @@ vout_thread_t *input_resource_HoldVout( input_resource_t * );
  *
  * You must call vlc_object_release on all values returned (if non NULL).
  */
-void input_resource_HoldVouts( input_resource_t *, vout_thread_t ***, int * );
+void input_resource_HoldVouts( input_resource_t *, vout_thread_t ***, size_t * );
 
 #endif