[vlc-commits] packetizer: dts: forward discontinuities

Francois Cartegnie git at videolan.org
Wed Oct 26 19:07:04 CEST 2016


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Oct 26 15:37:13 2016 +0200| [f12eff4d11803c03417a15e530c955e4cef02859] | committer: Francois Cartegnie

packetizer: dts: forward discontinuities

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

 modules/packetizer/dts.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/modules/packetizer/dts.c b/modules/packetizer/dts.c
index 847e564..f506ed7 100644
--- a/modules/packetizer/dts.c
+++ b/modules/packetizer/dts.c
@@ -65,6 +65,7 @@ struct decoder_sys_t
     bool    b_date_set;
 
     mtime_t i_pts;
+    bool    b_discontinuity;
 
     vlc_dts_header_t dts;
 };
@@ -73,6 +74,7 @@ static void PacketizeFlush( decoder_t *p_dec )
 {
     decoder_sys_t *p_sys = p_dec->p_sys;
 
+    p_sys->b_discontinuity = true;
     date_Set( &p_sys->end_date, 0 );
     p_sys->i_state = STATE_NOSYNC;
     block_BytestreamEmpty( &p_sys->bytestream );
@@ -135,7 +137,10 @@ static block_t *PacketizeBlock( decoder_t *p_dec, block_t **pp_block )
             return NULL;
         }
         else /* BLOCK_FLAG_DISCONTINUITY */
+        {
+            p_sys->b_discontinuity = true;
             date_Set( &p_sys->end_date, 0 );
+        }
 
     }
 
@@ -269,6 +274,12 @@ static block_t *PacketizeBlock( decoder_t *p_dec, block_t **pp_block )
             if( p_sys->i_pts == p_sys->bytestream.p_block->i_pts )
                 p_sys->i_pts = p_sys->bytestream.p_block->i_pts = VLC_TS_INVALID;
 
+            if( p_sys->b_discontinuity )
+            {
+                p_sys->b_discontinuity = false;
+                p_out_buffer->i_flags |= BLOCK_FLAG_DISCONTINUITY;
+            }
+
             /* So p_block doesn't get re-added several times */
             *pp_block = block_BytestreamPop( &p_sys->bytestream );
 
@@ -311,6 +322,7 @@ static int Open( vlc_object_t *p_this )
     date_Set( &p_sys->end_date, 0 );
     p_sys->i_pts = VLC_TS_INVALID;
     p_sys->b_date_set = false;
+    p_sys->b_discontinuity = false;
 
     block_BytestreamInit( &p_sys->bytestream );
 



More information about the vlc-commits mailing list