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

Francois Cartegnie git at videolan.org
Wed Apr 18 15:49:54 CEST 2018


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

demux: ogg: fix first oggds timestamps/drop regression

oggds uses 0 on first frame :/

(cherry picked from commit a09fbee51860f0ce7eb53c1b167bf7339863d4ef)

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

 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 8d5bf8fca2..5c72d6461a 100644
--- a/modules/demux/ogg.c
+++ b/modules/demux/ogg.c
@@ -1012,6 +1012,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 )
     {
@@ -1168,7 +1172,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 cb1adbb448..a4fe4bad4f 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