]> git.sesse.net Git - vlc/blobdiff - src/misc/picture.c
aout_PacketPlay: use aout_TimeReport(), restore resampling
[vlc] / src / misc / picture.c
index ae3efc94f28463bf1459825ba0b35cfe0f6c2181..b63f843af09df15c6a5197d6c7713bfefee47417 100644 (file)
@@ -107,7 +107,7 @@ void picture_Reset( picture_t *p_picture )
     p_picture->date = VLC_TS_INVALID;
     p_picture->b_force = false;
     p_picture->b_progressive = false;
-    p_picture->i_nb_fields = 0;
+    p_picture->i_nb_fields = 2;
     p_picture->b_top_field_first = false;
     picture_CleanupQuant( p_picture );
 }
@@ -136,6 +136,8 @@ int picture_Setup( picture_t *p_picture, vlc_fourcc_t i_chroma,
     p_picture->p_release_sys = NULL;
     p_picture->i_refcount = 0;
 
+    p_picture->i_nb_fields = 2;
+
     p_picture->i_qtype = QTYPE_NONE;
     p_picture->i_qstride = 0;
     p_picture->p_q = NULL;
@@ -156,7 +158,7 @@ int picture_Setup( picture_t *p_picture, vlc_fourcc_t i_chroma,
     */
     int i_modulo_w = 1;
     int i_modulo_h = 1;
-    int i_ratio_h  = 1;
+    unsigned int i_ratio_h  = 1;
     for( unsigned i = 0; i < p_dsc->plane_count; i++ )
     {
         i_modulo_w = LCM( i_modulo_w, 16 * p_dsc->p[i].w.den );
@@ -288,7 +290,12 @@ void plane_CopyPixels( plane_t *p_dst, const plane_t *p_src )
     const unsigned i_height = __MIN( p_dst->i_visible_lines,
                                      p_src->i_visible_lines );
 
-    if( p_src->i_pitch == p_dst->i_pitch )
+    /* The 2x visible pitch check does two things:
+       1) Makes field plane_t's work correctly (see the deinterlacer module)
+       2) Moves less data if the pitch and visible pitch differ much.
+    */
+    if( p_src->i_pitch == p_dst->i_pitch  &&
+        p_src->i_pitch < 2*p_src->i_visible_pitch )
     {
         /* There are margins, but with the same width : perfect ! */
         vlc_memcpy( p_dst->p_pixels, p_src->p_pixels,