[vlc-commits] packetizer: a52: move pts dedup

Francois Cartegnie git at videolan.org
Mon Apr 16 13:55:43 CEST 2018


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Apr 16 09:40:28 2018 +0200| [e6cf76ccdb140b8c82a16e5edd2a17cdcdb226a7] | committer: Francois Cartegnie

packetizer: a52: move pts dedup

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

 modules/packetizer/a52.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/modules/packetizer/a52.c b/modules/packetizer/a52.c
index f9972a7649..28c4ea010d 100644
--- a/modules/packetizer/a52.c
+++ b/modules/packetizer/a52.c
@@ -107,7 +107,11 @@ static block_t *GetOutBuffer( decoder_t *p_dec )
     if( p_sys->bytestream.p_block->i_pts != date_Get( &p_sys->end_date ) &&
         p_sys->bytestream.p_block->i_pts != VLC_TS_INVALID )
     {
-        date_Set( &p_sys->end_date, p_sys->bytestream.p_block->i_pts );
+        /* Make sure we don't reuse the same pts twice
+         * as A/52 in PES sends multiple times the same pts */
+        if( p_sys->bytestream.p_block->i_pts != p_sys->i_prev_bytestream_pts )
+            date_Set( &p_sys->end_date, p_sys->bytestream.p_block->i_pts );
+        p_sys->i_prev_bytestream_pts = p_sys->bytestream.p_block->i_pts;
         p_sys->bytestream.p_block->i_pts = VLC_TS_INVALID;
     }
 
@@ -157,15 +161,6 @@ static block_t *PacketizeBlock( decoder_t *p_dec, block_t **pp_block )
             }
         }
 
-        /* Make sure we don't reuse the same pts twice */
-        if( p_block->i_pts > VLC_TS_INVALID )
-        {
-            if( p_block->i_pts == p_sys->i_prev_bytestream_pts )
-                p_block->i_pts = VLC_TS_INVALID;
-            else
-                p_sys->i_prev_bytestream_pts = p_block->i_pts;
-        }
-
         block_BytestreamPush( &p_sys->bytestream, p_block );
     }
 



More information about the vlc-commits mailing list