Commit 8d07abcd authored by Christophe Massiot's avatar Christophe Massiot

* Really fixed MC segfault bug.

parent 6ff20862
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vdec_motion_common.c : common motion compensation routines common * vdec_motion_common.c : common motion compensation routines common
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * 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> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* Jean-Marc Dressler <polux@via.ecp.fr> * Jean-Marc Dressler <polux@via.ecp.fr>
...@@ -202,11 +202,6 @@ static __inline__ void Motion420( ...@@ -202,11 +202,6 @@ static __inline__ void Motion420(
/* Temporary variables to avoid recalculating things twice */ /* Temporary variables to avoid recalculating things twice */
int i_source_offset, i_dest_offset, i_c_height, i_c_select; 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)) i_source_offset = (p_mb->i_l_x + (i_mv_x >> 1))
+ (p_mb->i_motion_l_y + i_offset + (p_mb->i_motion_l_y + i_offset
+ b_source_field) + b_source_field)
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vpar_headers.h : video parser : headers parsing * vpar_headers.h : video parser : headers parsing
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * 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> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* Stphane Borel <stef@via.ecp.fr> * Stphane Borel <stef@via.ecp.fr>
...@@ -84,6 +84,8 @@ typedef struct sequence_s ...@@ -84,6 +84,8 @@ typedef struct sequence_s
picture_t * p_backward; /* current backward reference frame */ picture_t * p_backward; /* current backward reference frame */
mtime_t next_pts, next_dts; mtime_t next_pts, next_dts;
int i_current_rate; int i_current_rate;
boolean_t b_expect_discontinuity; /* reset the frame predictors
* after the current frame */
/* Copyright extension */ /* Copyright extension */
boolean_t b_copyright_flag; /* Whether the following boolean_t b_copyright_flag; /* Whether the following
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* video_parser.c : video parser thread * video_parser.c : video parser thread
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * 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> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* Samuel Hocevar <sam@via.ecp.fr> * Samuel Hocevar <sam@via.ecp.fr>
...@@ -240,6 +240,7 @@ static int InitThread( vpar_thread_t *p_vpar ) ...@@ -240,6 +240,7 @@ static int InitThread( vpar_thread_t *p_vpar )
p_vpar->sequence.chroma_nonintra_quant.b_allocated = 0; p_vpar->sequence.chroma_nonintra_quant.b_allocated = 0;
p_vpar->sequence.i_matrix_coefficients = 1; p_vpar->sequence.i_matrix_coefficients = 1;
p_vpar->sequence.next_pts = p_vpar->sequence.next_dts = 0; p_vpar->sequence.next_pts = p_vpar->sequence.next_dts = 0;
p_vpar->sequence.b_expect_discontinuity = 0;
/* Initialize copyright information */ /* Initialize copyright information */
p_vpar->sequence.b_copyright_flag = 0; p_vpar->sequence.b_copyright_flag = 0;
...@@ -540,18 +541,8 @@ static void BitstreamCallback ( bit_stream_t * p_bit_stream, ...@@ -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 ) if( DECODER_FIFO_START( *p_bit_stream->p_decoder_fifo )->b_discontinuity )
{ {
/* Escape the current picture and reset the picture predictors. */ /* Escape the current picture and reset the picture predictors. */
p_vpar->sequence.b_expect_discontinuity = 1;
p_vpar->picture.b_error = 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;
} }
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vpar_blocks.c : blocks parsing * vpar_blocks.c : blocks parsing
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * 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> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* Jean-Marc Dressler <polux@via.ecp.fr> * Jean-Marc Dressler <polux@via.ecp.fr>
...@@ -2093,6 +2093,7 @@ static __inline__ void vpar_PictureData( vpar_thread_t * p_vpar, ...@@ -2093,6 +2093,7 @@ static __inline__ void vpar_PictureData( vpar_thread_t * p_vpar,
* number of macroblocks of the picture, mark the missed ones * number of macroblocks of the picture, mark the missed ones
* as skipped. */ * as skipped. */
if( (i_coding_type == P_CODING_TYPE || i_coding_type == B_CODING_TYPE) if( (i_coding_type == P_CODING_TYPE || i_coding_type == B_CODING_TYPE)
&& !p_vpar->sequence.b_expect_discontinuity
&& p_vpar->picture.b_error && && p_vpar->picture.b_error &&
( (i_mb_address-i_mb_base) > (p_vpar->sequence.i_mb_size >> 1) ( (i_mb_address-i_mb_base) > (p_vpar->sequence.i_mb_size >> 1)
|| (i_structure != FRAME_STRUCTURE || (i_structure != FRAME_STRUCTURE
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vpar_headers.c : headers parsing * vpar_headers.c : headers parsing
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * 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> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* Stphane Borel <stef@via.ecp.fr> * Stphane Borel <stef@via.ecp.fr>
...@@ -469,6 +469,15 @@ static void PictureHeader( vpar_thread_t * p_vpar ) ...@@ -469,6 +469,15 @@ static void PictureHeader( vpar_thread_t * p_vpar )
int i_mb; int i_mb;
#endif #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 */ RemoveBits( &p_vpar->bit_stream, 10 ); /* temporal_reference */
p_vpar->picture.i_coding_type = GetBits( &p_vpar->bit_stream, 3 ); p_vpar->picture.i_coding_type = GetBits( &p_vpar->bit_stream, 3 );
RemoveBits( &p_vpar->bit_stream, 16 ); /* vbv_delay */ RemoveBits( &p_vpar->bit_stream, 16 ); /* vbv_delay */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment