[vlc-commits] codec: synchro: use VLC_TICK_INVALID to signal unknown PTS

Steve Lhomme git at videolan.org
Wed Sep 19 11:58:14 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed May  9 11:00:21 2018 +0200| [9b7859525d8b53f393361b6927b770d2a0e0d192] | committer: Steve Lhomme

codec: synchro: use VLC_TICK_INVALID to signal unknown PTS

otherwise a PTS of 0 is not allowed

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

 modules/codec/libmpeg2.c | 4 ++--
 modules/codec/synchro.c  | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/codec/libmpeg2.c b/modules/codec/libmpeg2.c
index 2dcf094c73..0f54b07f57 100644
--- a/modules/codec/libmpeg2.c
+++ b/modules/codec/libmpeg2.c
@@ -333,7 +333,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
                 /* Intra-slice refresh. Simulate a blank I picture. */
                 msg_Dbg( p_dec, "intra-slice refresh stream" );
                 decoder_SynchroNewPicture( p_sys->p_synchro,
-                                           I_CODING_TYPE, 2, 0, 0,
+                                           I_CODING_TYPE, 2, VLC_TICK_INVALID, 0,
                                            p_info->sequence->flags & SEQ_FLAG_LOW_DELAY );
                 decoder_SynchroDecode( p_sys->p_synchro );
                 decoder_SynchroEnd( p_sys->p_synchro, I_CODING_TYPE, 0 );
@@ -483,7 +483,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
                 if( p_sys->b_slice_i )
                 {
                     decoder_SynchroNewPicture( p_sys->p_synchro,
-                                               I_CODING_TYPE, 2, 0, 0,
+                                               I_CODING_TYPE, 2, VLC_TICK_INVALID, 0,
                                                p_sys->p_info->sequence->flags &
                                                             SEQ_FLAG_LOW_DELAY );
                     decoder_SynchroDecode( p_sys->p_synchro );
diff --git a/modules/codec/synchro.c b/modules/codec/synchro.c
index ac3e7c36c2..816a82b37e 100644
--- a/modules/codec/synchro.c
+++ b/modules/codec/synchro.c
@@ -497,7 +497,7 @@ void decoder_SynchroNewPicture( decoder_synchro_t * p_synchro, int i_coding_type
          * progressive_frame. */
         p_synchro->i_current_period = i_repeat_field;
 
-        if( next_pts )
+        if( next_pts != VLC_TICK_INVALID )
         {
             if( (next_pts - p_synchro->current_pts
                     > PTS_THRESHOLD
@@ -557,7 +557,7 @@ void decoder_SynchroNewPicture( decoder_synchro_t * p_synchro, int i_coding_type
             p_synchro->current_pts = next_dts;
         }
 
-        if( next_pts )
+        if( next_pts != VLC_TICK_INVALID )
         {
             /* Store the PTS for the next time we have to date an I picture. */
             p_synchro->backward_pts = next_pts;



More information about the vlc-commits mailing list