[vlc-commits] packetizer: h264: don't increment missing dts
Francois Cartegnie
git at videolan.org
Sat May 20 13:55:34 CEST 2017
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri May 19 19:25:37 2017 +0200| [f1cd3a4dfaf1e0f9a913f52433253e594f45d311] | committer: Francois Cartegnie
packetizer: h264: don't increment missing dts
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f1cd3a4dfaf1e0f9a913f52433253e594f45d311
---
modules/packetizer/h264.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/modules/packetizer/h264.c b/modules/packetizer/h264.c
index 8a91adbf72..7da8dc90b8 100644
--- a/modules/packetizer/h264.c
+++ b/modules/packetizer/h264.c
@@ -838,7 +838,8 @@ static block_t *OutputPicture( decoder_t *p_dec )
if( p_pic->i_pts == VLC_TS_INVALID )
{
- if( p_sys->prevdatedpoc.pts > VLC_TS_INVALID )
+ if( p_sys->prevdatedpoc.pts > VLC_TS_INVALID &&
+ date_Get( &p_sys->dts ) != VLC_TS_INVALID )
{
date_t pts = p_sys->dts;
date_Set( &pts, p_sys->prevdatedpoc.pts );
@@ -857,7 +858,8 @@ static block_t *OutputPicture( decoder_t *p_dec )
{
p_pic->i_pts = p_pic->i_dts;
}
- else if( p_sys->slice.type == H264_SLICE_TYPE_I )
+ else if( p_sys->slice.type == H264_SLICE_TYPE_I &&
+ date_Get( &p_sys->dts ) != VLC_TS_INVALID )
{
/* Hell no PTS on IDR. We're totally blind */
date_t pts = p_sys->dts;
@@ -898,7 +900,8 @@ static block_t *OutputPicture( decoder_t *p_dec )
if( !p_sys->b_discontinuity )
{
/* save for next pic fixups */
- date_Increment( &p_sys->dts, i_num_clock_ts );
+ if( date_Get( &p_sys->dts ) != VLC_TS_INVALID )
+ date_Increment( &p_sys->dts, i_num_clock_ts );
}
else
{
More information about the vlc-commits
mailing list