]> git.sesse.net Git - vlc/commitdiff
Fixed THX Cimmarron bug (it was _not_ a synchro bug).
authorChristophe Massiot <massiot@videolan.org>
Fri, 29 Dec 2000 12:49:30 +0000 (12:49 +0000)
committerChristophe Massiot <massiot@videolan.org>
Fri, 29 Dec 2000 12:49:30 +0000 (12:49 +0000)
src/video_decoder/vpar_synchro.h
src/video_parser/video_parser.c
src/video_parser/vpar_headers.c
src/video_parser/vpar_synchro.c

index 5be78d4928e8fb38c53e8c63b50e4fae75eadb8a..f4d0580a451b5a9949d260620111294941f7b0df 100644 (file)
@@ -2,7 +2,7 @@
  * 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>
  *
@@ -94,4 +94,5 @@ void vpar_SynchroDecode         ( struct vpar_thread_s * p_vpar,
                                   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 );
index 916d5bfdebba599f85e1df40f482f91ca04d253f..2026aa17171f86fb8f81bd6adf880e319bcfb9c7 100644 (file)
@@ -2,7 +2,7 @@
  * 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>
@@ -140,6 +140,7 @@ static int InitThread( vpar_thread_t *p_vpar )
     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;
index 949f61eacf711d8e51af8fa65f13f88282c3d7f8..98dd6f66b9374a7fb73f1558aed55140d5a63319 100644 (file)
@@ -2,7 +2,7 @@
  * 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>
@@ -622,7 +622,8 @@ static void PictureHeader( vpar_thread_t * p_vpar )
     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 )
         {
index c9435978d52a003fef3169f76806a7add1e3c153..0072eb3c14b898e517af09e5540da71786e88592 100644 (file)
@@ -2,7 +2,7 @@
  * 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>
@@ -414,7 +414,8 @@ mtime_t vpar_SynchroDate( vpar_thread_t * p_vpar )
 /*****************************************************************************
  * 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;
@@ -468,7 +469,17 @@ void vpar_SynchroNewPicture( vpar_thread_t * p_vpar, int i_coding_type )
     /* 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 )
     {
@@ -526,12 +537,16 @@ void vpar_SynchroNewPicture( vpar_thread_t * p_vpar, int i_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 )
@@ -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;
             }
+#endif
         }
     }