[vlc-commits] demux: ogg: fix first oggds timestamps/drop regression

Francois Cartegnie git at videolan.org
Wed Apr 18 15:10:17 CEST 2018


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Apr 18 15:06:32 2018 +0200| [a09fbee51860f0ce7eb53c1b167bf7339863d4ef] | committer: Francois Cartegnie

demux: ogg: fix first oggds timestamps/drop regression

oggds uses 0 on first frame :/

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

 modules/demux/ogg.c     | 11 ++++++++++-
 modules/demux/oggseek.c |  3 +--
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/modules/demux/ogg.c b/modules/demux/ogg.c
index c900f92a6c..12c962d26d 100644
--- a/modules/demux/ogg.c
+++ b/modules/demux/ogg.c
@@ -1025,6 +1025,10 @@ static void Ogg_UpdatePCR( demux_t *p_demux, logical_stream_t *p_stream,
     {
         /* We're in headers, and we haven't parsed 1st data packet yet */
 //        p_stream->i_pcr = VLC_TS_UNKNOWN;
+        if( p_stream->b_oggds && ogg_page_packets( p_oggpacket ) )
+        {
+            p_stream->i_pcr = VLC_TS_0 + p_ogg->i_nzpcr_offset;
+        }
     }
     else if( p_oggpacket->granulepos > 0 )
     {
@@ -1181,7 +1185,12 @@ static void Ogg_SendOrQueueBlocks( demux_t *p_demux, logical_stream_t *p_stream,
                 temp = temp->p_next;
                 tosend->p_next = NULL;
 
-                if( tosend->i_pts < VLC_TS_0 )
+                if( tosend->i_dts < VLC_TS_0 )
+                {
+                    tosend->i_dts = tosend->i_pts;
+                }
+
+                if( tosend->i_dts < VLC_TS_0 )
                 {
                     /* Don't send metadata from chained streams */
                     block_Release( tosend );
diff --git a/modules/demux/oggseek.c b/modules/demux/oggseek.c
index 2d4a2b6547..ddb0a158db 100644
--- a/modules/demux/oggseek.c
+++ b/modules/demux/oggseek.c
@@ -678,12 +678,11 @@ int64_t Oggseek_GranuleToAbsTimestamp( logical_stream_t *p_stream,
                                        int64_t i_granule, bool b_presentation )
 {
     int64_t i_timestamp = -1;
-    if ( i_granule < 1 )
+    if ( i_granule < 1 - !!p_stream->b_oggds )
         return -1;
 
     if ( p_stream->b_oggds )
     {
-        if ( b_presentation ) i_granule--;
         i_timestamp = i_granule * CLOCK_FREQ / p_stream->f_rate;
     }
     else  switch( p_stream->fmt.i_codec )



More information about the vlc-commits mailing list