[vlc-commits] demux: avformat: invert flv check order

Francois Cartegnie git at videolan.org
Fri Feb 24 11:30:26 CET 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Feb 24 11:09:19 2017 +0100| [c099968de56a8c5844995a9835198ad1849d1554] | committer: Francois Cartegnie

demux: avformat: invert flv check order

we might want to override timestamps, not just
deal with video pts

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

 modules/demux/avformat/demux.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/modules/demux/avformat/demux.c b/modules/demux/avformat/demux.c
index a41b2b2..ff2bf5d 100644
--- a/modules/demux/avformat/demux.c
+++ b/modules/demux/avformat/demux.c
@@ -810,12 +810,13 @@ static int Demux( demux_t *p_demux )
             p_stream->time_base.num /
             p_stream->time_base.den;
 
-    if( pkt.dts != (int64_t)AV_NOPTS_VALUE && pkt.dts == pkt.pts &&
-        p_stream->codecpar->codec_type == AVMEDIA_TYPE_VIDEO )
+    /* Add here notoriously bugged file formats/samples */
+    if( !strcmp( p_sys->fmt->name, "flv" ) )
     {
-        /* Add here notoriously bugged file formats/samples regarding PTS */
-        if( !strcmp( p_sys->fmt->name, "flv" ) )
-            p_frame->i_pts = VLC_TS_INVALID;
+        /* FLV and video PTS */
+        if( p_stream->codecpar->codec_type == AVMEDIA_TYPE_VIDEO &&
+            pkt.dts != (int64_t)AV_NOPTS_VALUE && pkt.dts == pkt.pts )
+                p_frame->i_pts = VLC_TS_INVALID;
     }
 #ifdef AVFORMAT_DEBUG
     msg_Dbg( p_demux, "tk[%d] dts=%"PRId64" pts=%"PRId64,



More information about the vlc-commits mailing list