[vlc-commits] demux: ogg: PTS to TICK_INVALID on missing interpolation

Francois Cartegnie git at videolan.org
Tue Feb 26 20:09:59 CET 2019


vlc/vlc-3.0 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Feb 11 12:50:12 2019 +0100| [d9ff8159a53e867dffe2adecbb8b80f9ca12ea53] | committer: Francois Cartegnie

demux: ogg: PTS to TICK_INVALID on missing interpolation

(cherry picked from commit edadd2849f840f117504f0bd1bd92b0b676ed223)

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

 modules/demux/ogg.c | 7 ++++++-
 modules/demux/ogg.h | 1 +
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/modules/demux/ogg.c b/modules/demux/ogg.c
index 0b368b77f8..f0027b197e 100644
--- a/modules/demux/ogg.c
+++ b/modules/demux/ogg.c
@@ -715,6 +715,7 @@ static void Ogg_ResetStream( logical_stream_t *p_stream )
     p_stream->i_pcr = VLC_TS_UNKNOWN;
     p_stream->i_previous_granulepos = -1;
     p_stream->i_previous_pcr = VLC_TS_UNKNOWN;
+    p_stream->b_interpolation_failed = false;
     ogg_stream_reset( &p_stream->os );
     FREENULL( p_stream->prepcr.pp_blocks );
     p_stream->prepcr.i_size = 0;
@@ -1137,6 +1138,7 @@ static void Ogg_UpdatePCR( demux_t *p_demux, logical_stream_t *p_stream,
             p_stream->i_pcr += ( CLOCK_FREQ * p_oggpacket->bytes /
                                  p_stream->fmt.i_bitrate / 8 );
         }
+        else p_stream->b_interpolation_failed = true;
     }
 
     p_stream->i_previous_granulepos = p_oggpacket->granulepos;
@@ -1477,7 +1479,8 @@ static void Ogg_DecodePacket( demux_t *p_demux,
 
         /* Blatant abuse of the i_length field. */
         p_block->i_length = p_stream->i_end_trim;
-        p_block->i_pts = p_block->i_dts = p_stream->i_pcr;
+        p_block->i_dts = p_stream->i_pcr;
+        p_block->i_pts = p_stream->b_interpolation_failed ? VLC_TS_INVALID : p_stream->i_pcr;
     }
     else if( p_stream->fmt.i_cat == SPU_ES )
     {
@@ -1485,6 +1488,8 @@ static void Ogg_DecodePacket( demux_t *p_demux,
         p_block->i_pts = p_block->i_dts = p_stream->i_pcr;
     }
 
+    p_stream->b_interpolation_failed = false;
+
     if( p_stream->fmt.i_codec != VLC_CODEC_VORBIS &&
         p_stream->fmt.i_codec != VLC_CODEC_SPEEX &&
         p_stream->fmt.i_codec != VLC_CODEC_OPUS &&
diff --git a/modules/demux/ogg.h b/modules/demux/ogg.h
index 16ac99793c..b7e52a1993 100644
--- a/modules/demux/ogg.h
+++ b/modules/demux/ogg.h
@@ -83,6 +83,7 @@ typedef struct logical_stream_s
      * granulepos */
     mtime_t          i_pcr;
     mtime_t          i_previous_pcr;
+    bool             b_interpolation_failed;    /* Don't use dts, it was not interpolated */
 
     /* Misc */
     bool b_initializing;



More information about the vlc-commits mailing list