[vlc-commits] packetizer: hevc: fix timestamp propagation

Francois Cartegnie git at videolan.org
Fri May 12 11:29:17 CEST 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri May 12 11:21:03 2017 +0200| [b45a95e15c2aabeaff203c55241bc9080fd4d40a] | committer: Francois Cartegnie

packetizer: hevc: fix timestamp propagation

next sync nal timestamp was not used

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

 modules/packetizer/hevc.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/modules/packetizer/hevc.c b/modules/packetizer/hevc.c
index 06f5a43fa2..e983fb8454 100644
--- a/modules/packetizer/hevc.c
+++ b/modules/packetizer/hevc.c
@@ -748,13 +748,11 @@ static block_t *ParseNALBlock(decoder_t *p_dec, bool *pb_ts_used, block_t *p_fra
     if(p_sys->b_need_ts)
     {
         if(p_frag->i_dts > VLC_TS_INVALID)
-        {
             date_Set(&p_sys->dts, p_frag->i_dts);
-            *pb_ts_used = true;
-        }
         p_sys->pts = p_frag->i_pts;
         if(date_Get( &p_sys->dts ) != VLC_TS_INVALID)
             p_sys->b_need_ts = false;
+        *pb_ts_used = true;
     }
 
     if(unlikely(p_frag->i_buffer < 5))
@@ -789,8 +787,11 @@ static block_t *ParseNALBlock(decoder_t *p_dec, bool *pb_ts_used, block_t *p_fra
     p_output = GatherAndValidateChain(p_output);
     if(p_output)
     {
-        p_sys->b_need_ts = true;
         SetOutputBlockProperties( p_dec, p_output );
+        if(p_frag->i_dts > VLC_TS_INVALID)
+            date_Set(&p_sys->dts, p_frag->i_dts);
+        p_sys->pts = p_frag->i_pts;
+        *pb_ts_used = true;
     }
 
     return p_output;



More information about the vlc-commits mailing list