* vpar_synchro.h : video parser blocks management
*****************************************************************************
* 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>
*
int i_coding_type, int i_structure );
void vpar_SynchroEnd ( struct vpar_thread_s * p_vpar, int i_garbage );
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 );
* video_parser.c : video parser thread
*****************************************************************************
* 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>
* Samuel Hocevar <sam@via.ecp.fr>
p_vpar->sequence.nonintra_quant.b_allocated = 0;
p_vpar->sequence.chroma_intra_quant.b_allocated = 0;
p_vpar->sequence.chroma_nonintra_quant.b_allocated = 0;
+ /* FIXME : initialize matrix_coefficients, but to what value ? */
/* Initialize copyright information */
p_vpar->sequence.b_copyright_flag = 0;
* vpar_headers.c : headers parsing
*****************************************************************************
* 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>
* Stéphane Borel <stef@via.ecp.fr>
else
{
/* 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 )
{
* vpar_synchro.c : frame dropping routines
*****************************************************************************
* 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>
* Samuel Hocevar <sam@via.ecp.fr>
/*****************************************************************************
* 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;
mtime_t period = 1000000 / (p_vpar->sequence.i_frame_rate) * 1001;
/* FIXME: use decoder_fifo callback */
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( p_pes->i_pts )
{
+#if 0
int i_n_b;
+#endif
/* Store the PTS for the next time we have to date an I picture. */
p_vpar->synchro.backward_pts = p_pes->i_pts;
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
- p_vpar->synchro.current_pts) / period - 1;
if( i_n_b != p_vpar->synchro.i_n_b )
p_vpar->synchro.i_n_b, i_n_b );
p_vpar->synchro.i_n_b = i_n_b;
}
+#endif
}
}