[vlc-devel] commit: Fixed decoder_SynchroChoose when buffering. (Laurent Aimar )

git version control git at videolan.org
Thu Jun 11 22:39:24 CEST 2009


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Wed Jun 10 21:46:12 2009 +0200| [641da394b5df71605a6fea8aad3c9367e9e6c0bf] | committer: Laurent Aimar 

Fixed decoder_SynchroChoose when buffering.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=641da394b5df71605a6fea8aad3c9367e9e6c0bf
---

 src/input/decoder_synchro.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/input/decoder_synchro.c b/src/input/decoder_synchro.c
index b88230e..9652d2e 100644
--- a/src/input/decoder_synchro.c
+++ b/src/input/decoder_synchro.c
@@ -251,8 +251,7 @@ bool decoder_SynchroChoose( decoder_synchro_t * p_synchro, int i_coding_type,
             pts = decoder_GetDisplayDate( p_synchro->p_dec, S.current_pts ) + period * (S.i_n_b + 2);
         }
 
-        if( (1 + S.i_n_p * (S.i_n_b + 1)) * period >
-                S.p_tau[I_CODING_TYPE] )
+        if( (1 + S.i_n_p * (S.i_n_b + 1)) * period > S.p_tau[I_CODING_TYPE] )
         {
             b_decode = 1;
         }
@@ -260,6 +259,9 @@ bool decoder_SynchroChoose( decoder_synchro_t * p_synchro, int i_coding_type,
         {
             b_decode = (pts - now) > (TAU_PRIME(I_CODING_TYPE) + DELTA);
         }
+        if( pts <= VLC_TS_INVALID )
+            b_decode = 1;
+
         if( !b_decode && !p_synchro->b_quiet )
         {
             msg_Warn( p_synchro->p_dec,
@@ -308,6 +310,8 @@ bool decoder_SynchroChoose( decoder_synchro_t * p_synchro, int i_coding_type,
         {
             b_decode = 0;
         }
+        if( p_synchro->i_nb_ref >= 1 && pts <= VLC_TS_INVALID )
+            b_decode = 1;
         break;
 
     case B_CODING_TYPE:
@@ -325,6 +329,9 @@ bool decoder_SynchroChoose( decoder_synchro_t * p_synchro, int i_coding_type,
         {
             b_decode = 0;
         }
+        if( p_synchro->i_nb_ref >= 2 && pts <= VLC_TS_INVALID )
+            b_decode = 1;
+        break;
     }
 
     if( !b_decode )




More information about the vlc-devel mailing list