[vlc-commits] access:dshow: handle the REFERENCE_TIME as an msftime_t

Steve Lhomme git at videolan.org
Wed Jul 4 13:14:46 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Jul  4 13:06:48 2018 +0200| [d5f11274f24b36063d36cbc995466eefc59df21b] | committer: Steve Lhomme

access:dshow: handle the REFERENCE_TIME as an msftime_t

It's also an integer in 100ns

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

 modules/access/dshow/dshow.cpp | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/modules/access/dshow/dshow.cpp b/modules/access/dshow/dshow.cpp
index 4c569847c9..7ed4ae6815 100644
--- a/modules/access/dshow/dshow.cpp
+++ b/modules/access/dshow/dshow.cpp
@@ -1884,25 +1884,24 @@ static int Demux( demux_t *p_demux )
                     p_stream->b_pts = true;
                 }
                 else
-                    i_pts = VLC_TICK_INVALID;
+                    i_pts = LONG_MIN;
             }
 
-            if( i_pts != VLC_TICK_INVALID ) {
+            if( i_pts != LONG_MIN ) {
                 i_pts += 5;
-                i_pts /= 10; /* 100-ns to µs conversion */
-                i_pts += VLC_TICK_0;
             }
 #if 0
             msg_Dbg( p_demux, "Read() stream: %i, size: %i, PTS: %" PRId64,
-                     i_stream, i_data_size, i_pts );
+                     i_stream, i_data_size, VLC_TICK_FROM_MSFTIME(i_pts) );
 #endif
 
             p_block = block_Alloc( i_data_size );
             memcpy( p_block->p_buffer, p_data, i_data_size );
-            p_block->i_pts = p_block->i_dts = i_pts;
+            p_block->i_pts = p_block->i_dts = i_pts == LONG_MIN ?
+                        VLC_TICK_INVALID : (VLC_TICK_FROM_MSFTIME(i_pts) + VLC_TICK_0);
 
-            if( i_pts != VLC_TICK_INVALID )
-                es_out_SetPCR( p_demux->out, i_pts );
+            if( p_block->i_pts != VLC_TICK_INVALID )
+                es_out_SetPCR( p_demux->out, p_block->i_pts );
             es_out_Send( p_demux->out, p_stream->p_es, p_block );
 
             i_samples--;



More information about the vlc-commits mailing list