[vlc-commits] demux: ogg: output negative timestamps from preskip

Francois Cartegnie git at videolan.org
Thu May 31 18:47:47 CEST 2018


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu May 24 17:10:43 2018 +0200| [f53f2d922ee3d3a6467c419b7fe99897b58e7ec1] | committer: Francois Cartegnie

demux: ogg: output negative timestamps from preskip

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

 modules/demux/ogg.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/modules/demux/ogg.c b/modules/demux/ogg.c
index ba1a5a7da5..63bcf17d78 100644
--- a/modules/demux/ogg.c
+++ b/modules/demux/ogg.c
@@ -1053,10 +1053,7 @@ static void Ogg_UpdatePCR( demux_t *p_demux, logical_stream_t *p_stream,
             if( p_stream->fmt.i_codec == VLC_CODEC_OPUS && p_oggpacket->e_o_s )
                 p_stream->i_end_trim = p_oggpacket->granulepos - sample;
 
-            if (sample >= p_stream->i_pre_skip)
-                sample -= p_stream->i_pre_skip;
-            else
-                sample = 0;
+            sample -= p_stream->i_pre_skip;
 
             p_stream->i_pcr =  VLC_TS_0 + sample * CLOCK_FREQ / p_stream->f_rate;
             p_stream->i_pcr += p_ogg->i_nzpcr_offset;
@@ -1123,10 +1120,7 @@ static void Ogg_UpdatePCR( demux_t *p_demux, logical_stream_t *p_stream,
             ogg_int64_t sample;
             p_oggpacket->granulepos = p_stream->i_previous_granulepos + i_duration;
             sample = p_stream->i_previous_granulepos;
-            if (sample >= p_stream->i_pre_skip)
-                sample -= p_stream->i_pre_skip;
-            else
-                sample = 0;
+            sample -= p_stream->i_pre_skip;
 
             p_stream->i_pcr = VLC_TS_0 + sample * CLOCK_FREQ / p_stream->f_rate;
             p_stream->i_pcr += p_ogg->i_nzpcr_offset;



More information about the vlc-commits mailing list