[vlc-commits] smf: simplify usage of VLC_TS_0

Rémi Denis-Courmont git at videolan.org
Thu Jul 10 19:51:59 CEST 2014


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Jul  9 22:56:02 2014 +0300| [3121b733a83936d2ebcbb27346698bbde15d6724] | committer: Rémi Denis-Courmont

smf: simplify usage of VLC_TS_0

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

 modules/demux/smf.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/modules/demux/smf.c b/modules/demux/smf.c
index 5ce0cfd..48407c2 100644
--- a/modules/demux/smf.c
+++ b/modules/demux/smf.c
@@ -342,7 +342,7 @@ int HandleMessage (demux_t *p_demux, mtrk_t *tr)
     }
 
 send:
-    block->i_dts = block->i_pts = VLC_TS_0 + date_Get (&p_demux->p_sys->pts);
+    block->i_dts = block->i_pts = date_Get (&p_demux->p_sys->pts);
     es_out_Send (p_demux->out, p_demux->p_sys->es, block);
 
 skip:
@@ -368,8 +368,7 @@ static int Demux (demux_t *p_demux)
     if (pulse == UINT64_MAX)
         return 0; /* all tracks are done */
 
-    es_out_Control (p_demux->out, ES_OUT_SET_PCR,
-                    VLC_TS_0 + date_Get (&p_sys->pts));
+    es_out_Control (p_demux->out, ES_OUT_SET_PCR, date_Get (&p_sys->pts));
 
     for (unsigned i = 0; i < p_sys->trackc; i++)
     {
@@ -543,7 +542,7 @@ static int Open (vlc_object_t *obj)
 
     /* Default SMF tempo is 120BPM, i.e. half a second per quarter note */
     date_Init (&sys->pts, ppqn * 2, 1);
-    date_Set (&sys->pts, 0);
+    date_Set (&sys->pts, VLC_TS_0);
     sys->pulse = 0;
     sys->ppqn = ppqn;
 



More information about the vlc-commits mailing list