]> git.sesse.net Git - vlc/blobdiff - modules/video_filter/ripple.c
atmo: fix mismatch allocation/deallocation.
[vlc] / modules / video_filter / ripple.c
index 6eab4f1c17fbf0a28c01b8f608edf507dcb0f181..55d78625f4ec1546ded3d48f92542a2e9a5606a7 100644 (file)
@@ -34,7 +34,6 @@
 
 #include <vlc_common.h>
 #include <vlc_plugin.h>
-#include <vlc_vout.h>
 #include <vlc_filter.h>
 #include "filter_picture.h"
 
@@ -61,7 +60,7 @@ vlc_module_begin ()
 vlc_module_end ()
 
 /*****************************************************************************
- * vout_sys_t: Distort video output method descriptor
+ * filter_sys_t: Distort video output method descriptor
  *****************************************************************************
  * This structure is part of the video output thread descriptor.
  * It describes the Distort specific properties of an output thread.
@@ -144,7 +143,15 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
 
         i_num_lines = p_pic->p[i_index].i_visible_lines;
         i_pixel_pitch = p_pic->p[i_index].i_pixel_pitch;
-        i_visible_pixels = p_pic->p[i_index].i_visible_pitch/p_pic->p[i_index].i_pixel_pitch;
+        switch( p_filter->fmt_in.video.i_chroma )
+        {
+            CASE_PACKED_YUV_422
+                // Quick hack to fix u/v inversion occuring with 2 byte pixel pitch
+                i_pixel_pitch *= 2;
+                break;
+        }
+
+        i_visible_pixels = p_pic->p[i_index].i_visible_pitch/i_pixel_pitch;
 
         i_first_line = i_num_lines * 4 / 5;
 
@@ -168,7 +175,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
                                                             - i_first_line) )
                          * (double)(i_line - i_first_line)
                          / (double)i_num_lines
-                         / 8.0 )*p_pic->p[i_index].i_pixel_pitch;
+                         / 8.0 )*i_pixel_pitch;
 
             if( i_offset )
             {