[vlc-devel] [PATCH 1/3] block_t: add a necessary i_delay

Jean-Baptiste Kempf jb at videolan.org
Sun Feb 20 22:42:33 CET 2011


From: Christophe Massiot <massiot at via.ecp.fr>

The i_delay flag is used by the TS mux. It represents the maximum amount
of advance time the block_t can be output, while still being T-STD
compliant (ie. without overflowing the T-STD buffers).
Of course the latest time of departure is i_dts.
---
 include/vlc_block.h |    1 +
 src/misc/block.c    |    2 ++
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/include/vlc_block.h b/include/vlc_block.h
index 7938986..b2c71d5 100644
--- a/include/vlc_block.h
+++ b/include/vlc_block.h
@@ -109,6 +109,7 @@ struct block_t
     mtime_t     i_pts;
     mtime_t     i_dts;
     mtime_t     i_length;
+    mtime_t     i_delay;
 
     unsigned    i_nb_samples; /* Used for audio */
     int         i_rate;
diff --git a/src/misc/block.c b/src/misc/block.c
index 9a463dd..dd33aa0 100644
--- a/src/misc/block.c
+++ b/src/misc/block.c
@@ -63,6 +63,7 @@ void block_Init( block_t *restrict b, void *buf, size_t size )
     b->i_flags = 0;
     b->i_pts =
     b->i_dts = VLC_TS_INVALID;
+    b->i_delay = 0;
     b->i_length = 0;
     b->i_rate = 0;
     b->i_nb_samples = 0;
@@ -83,6 +84,7 @@ static void BlockMetaCopy( block_t *restrict out, const block_t *in )
     out->p_next    = in->p_next;
     out->i_dts     = in->i_dts;
     out->i_pts     = in->i_pts;
+    out->i_delay   = in->i_delay;
     out->i_flags   = in->i_flags;
     out->i_length  = in->i_length;
     out->i_rate    = in->i_rate;
-- 
1.7.4.1




More information about the vlc-devel mailing list