Some small modifications to crop and panoramix to repair calls for uninitialized...
authorJean-Baptiste Kempf <jb@videolan.org>
Thu, 25 Jan 2007 19:42:49 +0000 (19:42 +0000)
committerJean-Baptiste Kempf <jb@videolan.org>
Thu, 25 Jan 2007 19:42:49 +0000 (19:42 +0000)
Patch by Cedric Coquebert.

modules/video_filter/crop.c
modules/video_filter/panoramix.c

index 2584780..9e16a6e 100644 (file)
@@ -238,7 +238,7 @@ static int Init( vout_thread_t *p_vout )
         p_vout->p_sys->i_ratio = 0;
     else
     {
-        p_vout->p_sys->i_ratio = config_GetInt( p_vout, "ratio" );
+        p_vout->p_sys->i_ratio = config_GetInt( p_vout, "crop-ratio" );
         // ratio < width / height => ratio = 0 (unchange ratio)
         if (p_vout->p_sys->i_ratio < (p_vout->output.i_width * 1000) / p_vout->output.i_height)
             p_vout->p_sys->i_ratio = 0;
@@ -353,15 +353,14 @@ static int Init( vout_thread_t *p_vout )
                      p_vout->p_sys->i_width, p_vout->p_sys->i_height,
                      p_vout->p_sys->i_x, p_vout->p_sys->i_y,
                      p_vout->p_sys->b_autocrop ? "" : "not " );
-#ifdef BEST_AUTOCROP
-    msg_Info( p_vout, "ratio %d",  p_vout->p_sys->i_aspect / 432);
-#endif
-
     /* Set current output image properties */
     p_vout->p_sys->i_aspect = p_vout->fmt_out.i_aspect
            * p_vout->fmt_out.i_visible_height / p_vout->p_sys->i_height
            * p_vout->p_sys->i_width / p_vout->fmt_out.i_visible_width;
 
+#ifdef BEST_AUTOCROP
+    msg_Info( p_vout, "ratio %d",  p_vout->p_sys->i_aspect / 432);
+#endif
     fmt.i_width = fmt.i_visible_width = p_vout->p_sys->i_width;
     fmt.i_height = fmt.i_visible_height = p_vout->p_sys->i_height;
     fmt.i_x_offset = fmt.i_y_offset = 0;
index b743321..c7ee0be 100644 (file)
@@ -636,6 +636,8 @@ static int Init( vout_thread_t *p_vout )
     p_vout->output.i_aspect = p_vout->render.i_aspect;
 #ifdef OVERLAP
     p_vout->p_sys->b_has_changed = p_vout->p_sys->b_attenuate;
+       int i_video_x = var_GetInteger( p_vout, "video-x");
+    int i_video_y = var_GetInteger( p_vout, "video-y");
 #ifdef GAMMA
     if (p_vout->p_sys->b_attenuate)
     {
@@ -836,8 +838,6 @@ static int Init( vout_thread_t *p_vout )
                 else if (i_row == p_vout->p_sys->i_row -1) p_vout->p_sys->pp_vout[ p_vout->p_sys->i_vout ].p_vout->i_alignment |= VOUT_ALIGN_TOP;
             }
     // i_n : number of active pp_vout
-                       int i_video_x = var_GetInteger( p_vout, "video-x");    
-               int i_video_y = var_GetInteger( p_vout, "video-y");     
             int i_index, i_n = p_vout->p_sys->i_vout;
                 for (i_index = p_vout->p_sys->i_vout; i_index >= 0; i_index--) if (!p_vout->p_sys->pp_vout[i_index].b_active) i_n -= 1;
             var_SetInteger( p_vout, "align", p_vout->p_sys->pp_vout[ p_vout->p_sys->i_vout ].p_vout->i_alignment );