[vlc-commits] demux: ogg: don't trigger preroll state from chained content

Francois Cartegnie git at videolan.org
Wed Jun 14 00:23:51 CEST 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Jun 13 17:56:09 2017 +0200| [90de0a7a987c1e7c1d24bcdc6feda0ecdec4314f] | committer: Francois Cartegnie

demux: ogg: don't trigger preroll state from chained content

avoids audio cut/rebuffering
invalid stamps still cause minor glitch

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

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

diff --git a/modules/demux/ogg.c b/modules/demux/ogg.c
index bd6b46d2b2..9e0b7cfc31 100644
--- a/modules/demux/ogg.c
+++ b/modules/demux/ogg.c
@@ -588,7 +588,8 @@ static int Demux( demux_t * p_demux )
                     if ( pagestamp < 0 )
                     {
                         p_block->i_pts = VLC_TS_INVALID;
-                        p_block->i_flags |= BLOCK_FLAG_PREROLL;
+                        if( p_sys->i_nzpcr_offset == 0 ) /* not on chained streams */
+                            p_block->i_flags |= BLOCK_FLAG_PREROLL;
                     }
                     else
                         p_block->i_pts = VLC_TS_0 + p_sys->i_nzpcr_offset + pagestamp;
@@ -1366,7 +1367,8 @@ static void Ogg_DecodePacket( demux_t *p_demux,
         {
             if( p_stream->i_skip_frames >= p_block->i_nb_samples )
             {
-                p_block->i_flags |= BLOCK_FLAG_PREROLL;
+                if( p_demux->p_sys->i_nzpcr_offset == 0 ) /* not on chained streams */
+                    p_block->i_flags |= BLOCK_FLAG_PREROLL;
                 p_stream->i_skip_frames -= p_block->i_nb_samples;
                 p_block->i_nb_samples = 0;
             }
@@ -1378,7 +1380,8 @@ static void Ogg_DecodePacket( demux_t *p_demux,
         }
         else
         {
-            p_block->i_flags |= BLOCK_FLAG_PREROLL;
+            if( p_demux->p_sys->i_nzpcr_offset == 0 ) /* not on chained streams */
+                p_block->i_flags |= BLOCK_FLAG_PREROLL;
             p_stream->i_skip_frames--;
         }
     }



More information about the vlc-commits mailing list