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

Francois Cartegnie git at videolan.org
Thu Feb 1 17:21:37 CET 2018


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Feb  1 17:20:33 2018 +0100| [66779d5bd8f89deb8a970dd294cd81da3c77a093] | committer: Francois Cartegnie

demux: caf: fix double TS_0

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

 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 3ff422f6fb..6477452adc 100644
--- a/modules/demux/caf.c
+++ b/modules/demux/caf.c
@@ -332,9 +332,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
@@ -982,7 +982,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