]> git.sesse.net Git - vlc/blobdiff - modules/video_filter/deinterlace.c
input options whitelisting, step 2 (refs #1371)
[vlc] / modules / video_filter / deinterlace.c
index 93a53e6e63c2d27139282459b1699016ea1029e8..cfe9afb5050b6632f00ba763042263c535f7dcab 100644 (file)
@@ -25,7 +25,6 @@
  * Preamble
  *****************************************************************************/
 #include <errno.h>
-#include <string.h>
 
 #include <vlc/vlc.h>
 #include <vlc_vout.h>
@@ -127,6 +126,7 @@ vlc_module_begin();
     add_string( "deinterlace-mode", "discard", NULL, MODE_TEXT,
                 MODE_LONGTEXT, VLC_FALSE );
         change_string_list( mode_list, mode_list_text, 0 );
+        change_safe();
 
     add_shortcut( "deinterlace" );
     set_callbacks( Create, Destroy );
@@ -136,6 +136,7 @@ vlc_module_begin();
     set_section( N_("Streaming"),NULL);
     add_string( FILTER_CFG_PREFIX "mode", "blend", NULL, SOUT_MODE_TEXT,
                 SOUT_MODE_LONGTEXT, VLC_FALSE );
+        change_safe();
         change_string_list( mode_list, mode_list_text, 0 );
     set_callbacks( OpenFilter, CloseFilter );
 vlc_module_end();
@@ -531,16 +532,16 @@ static void Render ( vout_thread_t *p_vout, picture_t *p_pic )
             break;
 
         case DEINTERLACE_BOB:
-            RenderBob( p_vout, pp_outpic[0], p_pic, 0 );
+            RenderBob( p_vout, pp_outpic[0], p_pic, p_pic->b_top_field_first ? 0 : 1 );
             vout_DisplayPicture( p_vout->p_sys->p_vout, pp_outpic[0] );
-            RenderBob( p_vout, pp_outpic[1], p_pic, 1 );
+            RenderBob( p_vout, pp_outpic[1], p_pic, p_pic->b_top_field_first ? 1 : 0 );
             vout_DisplayPicture( p_vout->p_sys->p_vout, pp_outpic[1] );
             break;
 
         case DEINTERLACE_LINEAR:
-            RenderLinear( p_vout, pp_outpic[0], p_pic, 0 );
+            RenderLinear( p_vout, pp_outpic[0], p_pic, p_pic->b_top_field_first ? 0 : 1 );
             vout_DisplayPicture( p_vout->p_sys->p_vout, pp_outpic[0] );
-            RenderLinear( p_vout, pp_outpic[1], p_pic, 1 );
+            RenderLinear( p_vout, pp_outpic[1], p_pic, p_pic->b_top_field_first ? 1 : 0 );
             vout_DisplayPicture( p_vout->p_sys->p_vout, pp_outpic[1] );
             break;
 
@@ -1010,10 +1011,10 @@ static void MergeSSE2( void *_p_dest, const void *_p_s1, const void *_p_s2,
     const uint8_t *p_s1 = (const uint8_t *)_p_s1;
     const uint8_t *p_s2 = (const uint8_t *)_p_s2;
     uint8_t* p_end;
-    while( (ptrdiff_t)p_s1 % 16 )
+    while( (uintptr_t)p_s1 % 16 )
     {
         *p_dest++ = ( (uint16_t)(*p_s1++) + (uint16_t)(*p_s2++) ) >> 1;
-    }        
+    }
     p_end = p_dest + i_bytes - 16;
     while( p_dest < p_end )
     {