From: Christophe Massiot Date: Tue, 16 Jan 2001 13:27:14 +0000 (+0000) Subject: * Change for the forthcoming fast forward and slow motion support. X-Git-Tag: 0.2.70~215 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=c760db3810ba11b626f5a83e09aca8bf6c86d477;p=vlc * Change for the forthcoming fast forward and slow motion support. --- diff --git a/src/video_decoder/vpar_synchro.h b/src/video_decoder/vpar_synchro.h index 1310af9ee5..245d84043a 100644 --- a/src/video_decoder/vpar_synchro.h +++ b/src/video_decoder/vpar_synchro.h @@ -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 * @@ -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; diff --git a/src/video_parser/vpar_synchro.c b/src/video_parser/vpar_synchro.c index 0e86d7ffce..9da47856b5 100644 --- a/src/video_parser/vpar_synchro.c +++ b/src/video_parser/vpar_synchro.c @@ -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 * Samuel Hocevar @@ -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 ) {