]> git.sesse.net Git - vlc/commitdiff
* Change for the forthcoming fast forward and slow motion support.
authorChristophe Massiot <massiot@videolan.org>
Tue, 16 Jan 2001 13:27:14 +0000 (13:27 +0000)
committerChristophe Massiot <massiot@videolan.org>
Tue, 16 Jan 2001 13:27:14 +0000 (13:27 +0000)
src/video_decoder/vpar_synchro.h
src/video_parser/vpar_synchro.c

index 1310af9ee5b384cba20e518762509493ed7ece85..245d84043ab5bba561ff948edf9ba88e44a02b5b 100644 (file)
@@ -2,7 +2,7 @@
  * vpar_synchro.h : video parser blocks management
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: vpar_synchro.h,v 1.6 2001/01/15 19:54:34 massiot Exp $
+ * $Id: vpar_synchro.h,v 1.7 2001/01/16 13:27:14 massiot Exp $
  *
  * Author: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -64,9 +64,10 @@ typedef struct video_synchro_s
     unsigned int    i_eta_p, i_eta_b;
     boolean_t       b_dropped_last;            /* for special synchros below */
     mtime_t         backward_pts, current_pts;
-    mtime_t         current_period;     /* period to add to the next picture */
-    mtime_t         backward_period;    /* period to add after the next
-                                         * reference picture                 */
+    int             i_current_period;   /* period to add to the next picture */
+    int             i_backward_period;  /* period to add after the next
+                                         * reference picture
+                                         * (backward_period * period / 2) */
 
 #ifdef STATS
     unsigned int    i_trashed_pic, i_not_chosen_pic, i_pic;
index 0e86d7ffce43db288058cddcb0b117155f21f2d1..9da47856b5434c74e0d8931f8073cda028c2a346 100644 (file)
@@ -2,7 +2,7 @@
  * vpar_synchro.c : frame dropping routines
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: vpar_synchro.c,v 1.74 2001/01/15 19:54:34 massiot Exp $
+ * $Id: vpar_synchro.c,v 1.75 2001/01/16 13:27:14 massiot Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *          Samuel Hocevar <sam@via.ecp.fr>
@@ -150,8 +150,8 @@ void vpar_SynchroInit( vpar_thread_t * p_vpar )
     memset( p_vpar->synchro.pi_meaningful, 0, 4 * sizeof(unsigned int) );
     p_vpar->synchro.b_dropped_last = 0;
     p_vpar->synchro.current_pts = mdate() + DEFAULT_PTS_DELAY;
-    p_vpar->synchro.backward_pts = p_vpar->synchro.current_period =
-        p_vpar->synchro.backward_period = 0;
+    p_vpar->synchro.backward_pts = 0;
+    p_vpar->synchro.i_current_period = p_vpar->synchro.i_backward_period = 0;
 #ifdef STATS
     p_vpar->synchro.i_trashed_pic = p_vpar->synchro.i_not_chosen_pic = 
         p_vpar->synchro.i_pic = 0;
@@ -469,7 +469,8 @@ void vpar_SynchroNewPicture( vpar_thread_t * p_vpar, int i_coding_type,
         break;
     }
 
-    p_vpar->synchro.current_pts += p_vpar->synchro.current_period;
+    p_vpar->synchro.current_pts += p_vpar->synchro.i_current_period
+                                        * (period >> 1);
 
 #define PTS_THRESHOLD   (period >> 2)
     if( i_coding_type == B_CODING_TYPE )
@@ -477,7 +478,7 @@ void vpar_SynchroNewPicture( vpar_thread_t * p_vpar, int i_coding_type,
         /* A video frame can be displayed 1, 2 or 3 times, according to
          * repeat_first_field, top_field_first, progressive_sequence and
          * progressive_frame. */
-        p_vpar->synchro.current_period = i_repeat_field * (period >> 1);
+        p_vpar->synchro.i_current_period = i_repeat_field;
 
         if( p_vpar->sequence.next_pts )
         {
@@ -497,8 +498,8 @@ void vpar_SynchroNewPicture( vpar_thread_t * p_vpar, int i_coding_type,
     }
     else
     {
-        p_vpar->synchro.current_period = p_vpar->synchro.backward_period;
-        p_vpar->synchro.backward_period = i_repeat_field * (period >> 1);
+        p_vpar->synchro.i_current_period = p_vpar->synchro.i_backward_period;
+        p_vpar->synchro.i_backward_period = i_repeat_field;
 
         if( p_vpar->synchro.backward_pts )
         {