]> git.sesse.net Git - vlc/commitdiff
* Really fixed MC segfault bug.
authorChristophe Massiot <massiot@videolan.org>
Tue, 13 Feb 2001 13:01:15 +0000 (13:01 +0000)
committerChristophe Massiot <massiot@videolan.org>
Tue, 13 Feb 2001 13:01:15 +0000 (13:01 +0000)
plugins/motion/vdec_motion_common.c
src/video_decoder/vpar_headers.h
src/video_parser/video_parser.c
src/video_parser/vpar_blocks.c
src/video_parser/vpar_headers.c

index 894aa98bd361151c1249c0955de0f7ebab6c83ce..e3b35ef911b3ef536d7b187980a670f9a2c8f0e0 100644 (file)
@@ -2,7 +2,7 @@
  * vdec_motion_common.c : common motion compensation routines common
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: vdec_motion_common.c,v 1.2 2001/02/13 06:31:05 sam Exp $
+ * $Id: vdec_motion_common.c,v 1.3 2001/02/13 13:01:14 massiot Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *          Jean-Marc Dressler <polux@via.ecp.fr>
@@ -202,11 +202,6 @@ static __inline__ void Motion420(
     /* Temporary variables to avoid recalculating things twice */
     int     i_source_offset, i_dest_offset, i_c_height, i_c_select;
 
-    if( p_source == NULL )
-    {
-        return;
-    }
-
     i_source_offset = (p_mb->i_l_x + (i_mv_x >> 1))
                        + (p_mb->i_motion_l_y + i_offset
                          + b_source_field)
index 5f825cafb52901673f46fab7d3a02af8bbd10936..458fb72bc53bc9b7ed838a4d2e567d0151e5acc1 100644 (file)
@@ -2,7 +2,7 @@
  * vpar_headers.h : video parser : headers parsing
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: vpar_headers.h,v 1.5 2001/01/24 19:05:55 massiot Exp $
+ * $Id: vpar_headers.h,v 1.6 2001/02/13 13:01:14 massiot Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *          Stéphane Borel <stef@via.ecp.fr>
@@ -84,6 +84,8 @@ typedef struct sequence_s
     picture_t *         p_backward;      /* current backward reference frame */
     mtime_t             next_pts, next_dts;
     int                 i_current_rate;
+    boolean_t           b_expect_discontinuity; /* reset the frame predictors
+                                                 * after the current frame   */
 
     /* Copyright extension */
     boolean_t           b_copyright_flag;     /* Whether the following
index 60ee50213948beb4ccb37d13a3786b4aa7206d83..074daeca354966eadbaeb3326ec8dd97474e46ba 100644 (file)
@@ -2,7 +2,7 @@
  * video_parser.c : video parser thread
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: video_parser.c,v 1.73 2001/02/11 01:15:12 sam Exp $
+ * $Id: video_parser.c,v 1.74 2001/02/13 13:01:14 massiot Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *          Samuel Hocevar <sam@via.ecp.fr>
@@ -240,6 +240,7 @@ static int InitThread( vpar_thread_t *p_vpar )
     p_vpar->sequence.chroma_nonintra_quant.b_allocated = 0;
     p_vpar->sequence.i_matrix_coefficients = 1;
     p_vpar->sequence.next_pts = p_vpar->sequence.next_dts = 0;
+    p_vpar->sequence.b_expect_discontinuity = 0;
 
     /* Initialize copyright information */
     p_vpar->sequence.b_copyright_flag = 0;
@@ -540,18 +541,8 @@ static void BitstreamCallback ( bit_stream_t * p_bit_stream,
         if( DECODER_FIFO_START( *p_bit_stream->p_decoder_fifo )->b_discontinuity )
         {
             /* Escape the current picture and reset the picture predictors. */
+            p_vpar->sequence.b_expect_discontinuity = 1;
             p_vpar->picture.b_error = 1;
-            if( p_vpar->sequence.p_forward != NULL )
-            {
-                vout_UnlinkPicture( p_vpar->p_vout, p_vpar->sequence.p_forward );
-            }
-            if( p_vpar->sequence.p_backward != NULL )
-            {
-                vout_DatePicture( p_vpar->p_vout, p_vpar->sequence.p_backward,
-                                  vpar_SynchroDate( p_vpar ) );
-                vout_UnlinkPicture( p_vpar->p_vout, p_vpar->sequence.p_backward );
-            }
-            p_vpar->sequence.p_forward = p_vpar->sequence.p_backward = NULL;
         }
     }
 
index e4e723bd6f9f783643cf8c297c9a08d98b941f20..bdf3063eb643ed3dfefcecb8ef0510dbe969f0ed 100644 (file)
@@ -2,7 +2,7 @@
  * vpar_blocks.c : blocks parsing
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: vpar_blocks.c,v 1.75 2001/02/11 01:15:12 sam Exp $
+ * $Id: vpar_blocks.c,v 1.76 2001/02/13 13:01:15 massiot Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *          Jean-Marc Dressler <polux@via.ecp.fr>
@@ -2093,6 +2093,7 @@ static __inline__ void vpar_PictureData( vpar_thread_t * p_vpar,
      * number of macroblocks of the picture, mark the missed ones
      * as skipped. */
     if( (i_coding_type == P_CODING_TYPE || i_coding_type == B_CODING_TYPE)
+        && !p_vpar->sequence.b_expect_discontinuity
         && p_vpar->picture.b_error &&
         ( (i_mb_address-i_mb_base) > (p_vpar->sequence.i_mb_size >> 1)
            || (i_structure != FRAME_STRUCTURE
index e32a0b73867698dbacd919beff1d2dbefb05a05a..988ab25097e5ca2bee98f029cdc6f5d9838c9e54 100644 (file)
@@ -2,7 +2,7 @@
  * vpar_headers.c : headers parsing
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: vpar_headers.c,v 1.77 2001/02/11 01:15:12 sam Exp $
+ * $Id: vpar_headers.c,v 1.78 2001/02/13 13:01:15 massiot Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *          Stéphane Borel <stef@via.ecp.fr>
@@ -469,6 +469,15 @@ static void PictureHeader( vpar_thread_t * p_vpar )
     int                 i_mb;
 #endif
 
+    /* Recover in case of stream discontinuity. */
+    if( p_vpar->sequence.b_expect_discontinuity )
+    {
+        ReferenceUpdate( p_vpar, I_CODING_TYPE, NULL );
+        ReferenceUpdate( p_vpar, I_CODING_TYPE, NULL );
+        p_vpar->sequence.b_expect_discontinuity = 0;
+    }
+
+    /* Parse the picture header. */
     RemoveBits( &p_vpar->bit_stream, 10 ); /* temporal_reference */
     p_vpar->picture.i_coding_type = GetBits( &p_vpar->bit_stream, 3 );
     RemoveBits( &p_vpar->bit_stream, 16 ); /* vbv_delay */