From 9da41db10758e8cfef142f3d2a1542439d723230 Mon Sep 17 00:00:00 2001 From: Francois Cartegnie Date: Wed, 16 Jan 2019 12:26:48 +0100 Subject: [PATCH] packetizer: h264: fix pts < dts from POC --- modules/packetizer/h264.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/packetizer/h264.c b/modules/packetizer/h264.c index fa66523c46..3b65de9e82 100644 --- a/modules/packetizer/h264.c +++ b/modules/packetizer/h264.c @@ -941,6 +941,9 @@ static block_t *OutputPicture( decoder_t *p_dec ) date_Decrement( &pts, -diff ); p_pic->i_pts = date_Get( &pts ); + /* non monotonically increasing dts on some videos 33333 33333...35000 */ + if( p_pic->i_pts < p_pic->i_dts ) + p_pic->i_pts = p_pic->i_dts; } /* In case there's no PTS at all */ else if( CanSwapPTSwithDTS( &p_sys->slice, p_sps ) ) -- 2.11.4.GIT