[vlc-commits] demux: caf: fix double TS_0

Francois Cartegnie git at videolan.org
Fri Feb 2 15:50:27 CET 2018


vlc/vlc-3.0 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Feb  1 17:20:33 2018 +0100| [fd000fea8d98fd6acb5c19a1cd5491b55c7af3c8] | committer: Jean-Baptiste Kempf

demux: caf: fix double TS_0

(cherry picked from commit 66779d5bd8f89deb8a970dd294cd81da3c77a093)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/demux/caf.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/demux/caf.c b/modules/demux/caf.c
index 0157e51d9e..b1a621f594 100644
--- a/modules/demux/caf.c
+++ b/modules/demux/caf.c
@@ -333,9 +333,9 @@ static int FrameSpanAddDescription( demux_t *p_demux, uint64_t i_desc_offset, fr
 static inline mtime_t FrameSpanGetTime( frame_span_t *span, uint32_t i_sample_rate )
 {
     if( !i_sample_rate )
-        return 0;
+        return VLC_TS_INVALID;
 
-    return ( span->i_samples * CLOCK_FREQ ) / i_sample_rate + 1;
+    return ( span->i_samples * CLOCK_FREQ ) / i_sample_rate + VLC_TS_0;
 }
 
 /* SetSpanWithSample returns the span from the beginning of the file up to and
@@ -998,7 +998,7 @@ static int Demux( demux_t *p_demux )
     }
 
     p_block->i_dts =
-    p_block->i_pts = VLC_TS_0 + FrameSpanGetTime( &p_sys->position, p_sys->fmt.audio.i_rate );
+    p_block->i_pts = FrameSpanGetTime( &p_sys->position, p_sys->fmt.audio.i_rate );
 
     FrameSpanAddSpan( &p_sys->position, &advance );
 



More information about the vlc-commits mailing list