[vlc-commits] Dshow: fix freeze

Jean-Baptiste Kempf git at videolan.org
Wed Jul 15 09:00:22 CEST 2015


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Wed Jul 15 08:51:05 2015 +0200| [a81cc9be43b5f2a6b3ecdb3b2850f28fd22a9a5e] | committer: Jean-Baptiste Kempf

Dshow: fix freeze

Close #14278

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

 modules/access/dshow/dshow.cpp |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/modules/access/dshow/dshow.cpp b/modules/access/dshow/dshow.cpp
index 000089a..e8cc75c 100644
--- a/modules/access/dshow/dshow.cpp
+++ b/modules/access/dshow/dshow.cpp
@@ -1871,7 +1871,7 @@ static int Demux( demux_t *p_demux )
 
             REFERENCE_TIME i_pts, i_end_date;
             HRESULT hr = sample.p_sample->GetTime( &i_pts, &i_end_date );
-            if( hr == S_OK || hr == VFW_S_NO_STOP_TIME )
+            if( hr != S_OK && hr != VFW_S_NO_STOP_TIME )
             {
                 if( p_stream->mt.majortype == MEDIATYPE_Video || !p_stream->b_pts )
                 {
@@ -1879,12 +1879,15 @@ static int Demux( demux_t *p_demux )
                     i_pts = sample.i_timestamp;
                     p_stream->b_pts = true;
                 }
+                else
+                    i_pts = VLC_TS_INVALID;
+            }
+
+            if( i_pts > VLC_TS_INVALID ) {
                 i_pts += (i_pts >= 0) ? +5 : -4;
                 i_pts /= 10; /* 100-ns to µs conversion */
                 i_pts += VLC_TS_0;
             }
-            else
-                i_pts = VLC_TS_INVALID;
 #if 0
             msg_Dbg( p_demux, "Read() stream: %i, size: %i, PTS: %" PRId64,
                      i_stream, i_data_size, i_pts );



More information about the vlc-commits mailing list