[vlc-commits] demux: ogg: no pts for non xiph video codecs (fix #19271)

Francois Cartegnie git at videolan.org
Sun Dec 17 16:11:31 CET 2017


vlc/vlc-2.2 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Dec 15 14:44:22 2017 +0100| [437d9b0a58a519ec54beab2a80979e88235691a5] | committer: Francois Cartegnie

demux: ogg: no pts for non xiph video codecs (fix #19271)

(cherry picked from commit 684c0f8ec1fc223d3f04aeed246b9e8d8782e644)

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

 modules/demux/ogg.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/modules/demux/ogg.c b/modules/demux/ogg.c
index b9d32664ac..18c6642277 100644
--- a/modules/demux/ogg.c
+++ b/modules/demux/ogg.c
@@ -1314,7 +1314,6 @@ static void Ogg_DecodePacket( demux_t *p_demux,
     }
 
     if( !( p_block = block_Alloc( p_oggpacket->bytes ) ) ) return;
-    p_block->i_pts = p_stream->i_pcr;
 
     DemuxDebug( msg_Dbg(p_demux, "block set from granule %"PRId64" to pts/pcr %"PRId64" skip %d",
                         p_oggpacket->granulepos, p_stream->i_pcr, p_stream->i_skip_frames); )
@@ -1365,6 +1364,16 @@ static void Ogg_DecodePacket( demux_t *p_demux,
                 p_block->i_dts = p_stream->i_pcr;
             }
         }
+        else if( p_stream->fmt.i_codec == VLC_CODEC_THEORA )
+        {
+            p_block->i_pts =
+            p_block->i_dts = p_stream->i_pcr;
+        }
+        else
+        {
+            p_block->i_pts = VLC_TS_INVALID;
+            p_block->i_dts = p_stream->i_pcr;
+        }
     }
     else if( p_stream->fmt.i_cat == AUDIO_ES )
     {
@@ -1389,10 +1398,12 @@ 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;
     }
     else if( p_stream->fmt.i_cat == SPU_ES )
     {
         p_block->i_length = 0;
+        p_block->i_pts = p_block->i_dts = p_stream->i_pcr;
     }
 
     if( p_stream->fmt.i_codec != VLC_CODEC_VORBIS &&



More information about the vlc-commits mailing list