[vlc-devel] [PATCH 14/24] [packetizer/dirac] Use date_t for calculation of pts & dts
davidf+nntp at woaf.net
davidf+nntp at woaf.net
Thu Oct 30 12:29:43 CET 2008
From: David Flynn <davidf at rd.bbc.co.uk>
Currently there are some fudges in this when inventing dts:
- pts should start at zero, which implies that dts should initially be <0
However, VLC currently discards blocks with i_(dts|pts) < 0.
- the initial offset between pts and dts is assumed to be 3.
Signed-off-by: David Flynn <davidf at rd.bbc.co.uk>
---
modules/packetizer/dirac.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/modules/packetizer/dirac.c b/modules/packetizer/dirac.c
index 39f0ee8..3fe877e 100644
--- a/modules/packetizer/dirac.c
+++ b/modules/packetizer/dirac.c
@@ -212,8 +212,14 @@ static block_t *Packetize( decoder_t *p_dec, block_t **pp_block )
date_t pts;
date_Init( &pts, p_sys->m_seq_hdr.u_fps_num, p_sys->m_seq_hdr.u_fps_den );
p_pic->i_pts = date_Increment( &pts, u_picnum+3 ) + 1;
- p_pic->i_pts = 1 + (3+u_picnum) * INT64_C(1000000) / ((float) p_sys->m_seq_hdr.u_fps_num / p_sys->m_seq_hdr.u_fps_den);
p_pic->i_dts = date_Get( &p_sys->m_dts ) + 1;
+#if 0
+ /* Ideally, dts should start -ve and pts start at 0. however,
+ * VLC currently discards blocks with i_(dts|pts) < 0.
+ * davidf considers this to be a bug FIXME please */
+ date_Set( &pts, 0 );
+ p_pic->i_dts -= date_Increment( &pts, 3 );
+#endif
}
date_Increment( &p_sys->m_dts, 1);
--
1.5.6.5
More information about the vlc-devel
mailing list