[vlc-commits] demux: ogg: simplify

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


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed May 23 14:24:36 2018 +0200| [f86120599e1b71fc78e156abe5f4ee20d19ea8f1] | committer: Francois Cartegnie

demux: ogg: simplify

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

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

diff --git a/modules/demux/ogg.c b/modules/demux/ogg.c
index 7198305ba2..08412cb00f 100644
--- a/modules/demux/ogg.c
+++ b/modules/demux/ogg.c
@@ -1159,25 +1159,21 @@ static void Ogg_SendOrQueueBlocks( demux_t *p_demux, logical_stream_t *p_stream,
     else
     {
         /* Because ES creation is delayed for preparsing */
-        mtime_t i_firstpts = VLC_TS_UNKNOWN;
         if ( p_stream->p_preparse_block )
         {
             block_t *temp = p_stream->p_preparse_block;
             while ( temp )
             {
-                if ( temp && i_firstpts < VLC_TS_0 )
-                    i_firstpts = temp->i_pts;
-
                 block_t *tosend = temp;
                 temp = temp->p_next;
                 tosend->p_next = NULL;
 
-                if( tosend->i_dts < VLC_TS_0 )
+                if( tosend->i_dts == VLC_TS_INVALID )
                 {
                     tosend->i_dts = tosend->i_pts;
                 }
 
-                if( tosend->i_dts < VLC_TS_0 )
+                if( tosend->i_dts == VLC_TS_INVALID )
                 {
                     /* Don't send metadata from chained streams */
                     block_Release( tosend );
@@ -1187,9 +1183,9 @@ static void Ogg_SendOrQueueBlocks( demux_t *p_demux, logical_stream_t *p_stream,
                 DemuxDebug( msg_Dbg( p_demux, "block sent from preparse > dts %"PRId64" pts %"PRId64" spcr %"PRId64" pcr %"PRId64,
                          tosend->i_dts, tosend->i_pts, p_stream->i_pcr, p_ogg->i_pcr ); )
 
-                if ( p_ogg->i_pcr == VLC_TS_INVALID && i_firstpts != VLC_TS_INVALID )
+                if ( p_ogg->i_pcr == VLC_TS_INVALID && tosend->i_dts != VLC_TS_INVALID )
                 {
-                    p_ogg->i_pcr = i_firstpts;
+                    p_ogg->i_pcr = tosend->i_dts;
                     if( likely( !p_ogg->b_slave ) )
                         es_out_SetPCR( p_demux->out, p_ogg->i_pcr );
                 }



More information about the vlc-commits mailing list