Commit 67bef288 authored by Christophe Massiot's avatar Christophe Massiot

Fixed THX Cimmarron bug (it was _not_ a synchro bug).

parent 555bac08
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vpar_synchro.h : video parser blocks management * vpar_synchro.h : video parser blocks management
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: vpar_synchro.h,v 1.3 2000/12/27 18:09:02 massiot Exp $ * $Id: vpar_synchro.h,v 1.4 2000/12/29 12:49:29 massiot Exp $
* *
* Author: Christophe Massiot <massiot@via.ecp.fr> * Author: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -94,4 +94,5 @@ void vpar_SynchroDecode ( struct vpar_thread_s * p_vpar, ...@@ -94,4 +94,5 @@ void vpar_SynchroDecode ( struct vpar_thread_s * p_vpar,
int i_coding_type, int i_structure ); int i_coding_type, int i_structure );
void vpar_SynchroEnd ( struct vpar_thread_s * p_vpar, int i_garbage ); void vpar_SynchroEnd ( struct vpar_thread_s * p_vpar, int i_garbage );
mtime_t vpar_SynchroDate ( struct vpar_thread_s * p_vpar ); mtime_t vpar_SynchroDate ( struct vpar_thread_s * p_vpar );
void vpar_SynchroNewPicture( struct vpar_thread_s * p_vpar, int i_coding_type ); void vpar_SynchroNewPicture( struct vpar_thread_s * p_vpar, int i_coding_type,
boolean_t b_repeat_field );
...@@ -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.58 2000/12/22 13:04:45 sam Exp $ * $Id: video_parser.c,v 1.59 2000/12/29 12:49:29 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>
...@@ -140,6 +140,7 @@ static int InitThread( vpar_thread_t *p_vpar ) ...@@ -140,6 +140,7 @@ static int InitThread( vpar_thread_t *p_vpar )
p_vpar->sequence.nonintra_quant.b_allocated = 0; p_vpar->sequence.nonintra_quant.b_allocated = 0;
p_vpar->sequence.chroma_intra_quant.b_allocated = 0; p_vpar->sequence.chroma_intra_quant.b_allocated = 0;
p_vpar->sequence.chroma_nonintra_quant.b_allocated = 0; p_vpar->sequence.chroma_nonintra_quant.b_allocated = 0;
/* FIXME : initialize matrix_coefficients, but to what value ? */
/* Initialize copyright information */ /* Initialize copyright information */
p_vpar->sequence.b_copyright_flag = 0; p_vpar->sequence.b_copyright_flag = 0;
......
...@@ -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.64 2000/12/29 10:52:40 massiot Exp $ * $Id: vpar_headers.c,v 1.65 2000/12/29 12:49:30 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>
...@@ -622,7 +622,8 @@ static void PictureHeader( vpar_thread_t * p_vpar ) ...@@ -622,7 +622,8 @@ static void PictureHeader( vpar_thread_t * p_vpar )
else else
{ {
/* Warn synchro we have a new picture (updates pictures index). */ /* Warn synchro we have a new picture (updates pictures index). */
vpar_SynchroNewPicture( p_vpar, p_vpar->picture.i_coding_type ); vpar_SynchroNewPicture( p_vpar, p_vpar->picture.i_coding_type,
p_vpar->picture.b_repeat_first_field );
if( b_parsable ) if( b_parsable )
{ {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vpar_synchro.c : frame dropping routines * vpar_synchro.c : frame dropping routines
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: vpar_synchro.c,v 1.67 2000/12/29 10:52:40 massiot Exp $ * $Id: vpar_synchro.c,v 1.68 2000/12/29 12:49:30 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>
...@@ -414,7 +414,8 @@ mtime_t vpar_SynchroDate( vpar_thread_t * p_vpar ) ...@@ -414,7 +414,8 @@ mtime_t vpar_SynchroDate( vpar_thread_t * p_vpar )
/***************************************************************************** /*****************************************************************************
* vpar_SynchroNewPicture: Update stream structure and PTS * vpar_SynchroNewPicture: Update stream structure and PTS
*****************************************************************************/ *****************************************************************************/
void vpar_SynchroNewPicture( vpar_thread_t * p_vpar, int i_coding_type ) void vpar_SynchroNewPicture( vpar_thread_t * p_vpar, int i_coding_type,
boolean_t b_repeat_field )
{ {
pes_packet_t * p_pes; pes_packet_t * p_pes;
mtime_t period = 1000000 / (p_vpar->sequence.i_frame_rate) * 1001; mtime_t period = 1000000 / (p_vpar->sequence.i_frame_rate) * 1001;
...@@ -468,7 +469,17 @@ void vpar_SynchroNewPicture( vpar_thread_t * p_vpar, int i_coding_type ) ...@@ -468,7 +469,17 @@ void vpar_SynchroNewPicture( vpar_thread_t * p_vpar, int i_coding_type )
/* FIXME: use decoder_fifo callback */ /* FIXME: use decoder_fifo callback */
p_pes = DECODER_FIFO_START( *p_vpar->bit_stream.p_decoder_fifo ); p_pes = DECODER_FIFO_START( *p_vpar->bit_stream.p_decoder_fifo );
p_vpar->synchro.current_pts += period; if( b_repeat_field )
{
/* MPEG-2 repeat_first_field */
/* FIXME : this is not exactly what we should do, repeat_first_field
* only regards the next picture */
p_vpar->synchro.current_pts += period + (period >> 1);
}
else
{
p_vpar->synchro.current_pts += period;
}
if( i_coding_type == B_CODING_TYPE ) if( i_coding_type == B_CODING_TYPE )
{ {
...@@ -526,12 +537,16 @@ void vpar_SynchroNewPicture( vpar_thread_t * p_vpar, int i_coding_type ) ...@@ -526,12 +537,16 @@ void vpar_SynchroNewPicture( vpar_thread_t * p_vpar, int i_coding_type )
if( p_pes->i_pts ) if( p_pes->i_pts )
{ {
#if 0
int i_n_b; int i_n_b;
#endif
/* Store the PTS for the next time we have to date an I picture. */ /* Store the PTS for the next time we have to date an I picture. */
p_vpar->synchro.backward_pts = p_pes->i_pts; p_vpar->synchro.backward_pts = p_pes->i_pts;
p_pes->i_pts = 0; p_pes->i_pts = 0;
/* FIXME : disabled because it conflicts with streams having
* b_repeat_first_field */
#if 0
i_n_b = (p_vpar->synchro.backward_pts i_n_b = (p_vpar->synchro.backward_pts
- p_vpar->synchro.current_pts) / period - 1; - p_vpar->synchro.current_pts) / period - 1;
if( i_n_b != p_vpar->synchro.i_n_b ) if( i_n_b != p_vpar->synchro.i_n_b )
...@@ -542,6 +557,7 @@ void vpar_SynchroNewPicture( vpar_thread_t * p_vpar, int i_coding_type ) ...@@ -542,6 +557,7 @@ void vpar_SynchroNewPicture( vpar_thread_t * p_vpar, int i_coding_type )
p_vpar->synchro.i_n_b, i_n_b ); p_vpar->synchro.i_n_b, i_n_b );
p_vpar->synchro.i_n_b = i_n_b; p_vpar->synchro.i_n_b = i_n_b;
} }
#endif
} }
} }
......
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