[vlc-devel] [PATCH 16/16] demux:asf: handle the i_pkt_time_delta in mtime_t instead of milliseconds

Steve Lhomme robux4 at ycbcr.xyz
Thu Jun 7 12:00:00 CEST 2018


---
 modules/demux/asf/asfpacket.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/demux/asf/asfpacket.c b/modules/demux/asf/asfpacket.c
index 9e6d6e5277..5e91439148 100644
--- a/modules/demux/asf/asfpacket.c
+++ b/modules/demux/asf/asfpacket.c
@@ -208,7 +208,7 @@ static int DemuxPayload(asf_packet_sys_t *p_packetsys, asf_packet_t *pkt, int i_
         return -1;
 
     mtime_t i_pkt_time;
-    uint8_t i_pkt_time_delta = 0;
+    mtime_t i_pkt_time_delta = 0;
     uint32_t i_payload_data_length = 0;
     uint32_t i_temp_payload_length = 0;
 
@@ -249,7 +249,7 @@ static int DemuxPayload(asf_packet_sys_t *p_packetsys, asf_packet_t *pkt, int i_
     {
         /* i_media_object_offset is *media* presentation time */
         /* Next byte is *media* Presentation Time Delta */
-        i_pkt_time_delta = pkt->p_peek[pkt->i_skip];
+        i_pkt_time_delta = MS_TO_MTIME(pkt->p_peek[pkt->i_skip]);
         b_ignore_pts = false;
         i_pkt_time = MS_TO_MTIME(i_media_object_offset);
         i_pkt_time -= *p_packetsys->pi_preroll;
@@ -333,7 +333,7 @@ static int DemuxPayload(asf_packet_sys_t *p_packetsys, asf_packet_t *pkt, int i_
         SkipBytes( p_demux->s, pkt->i_skip );
 
         mtime_t i_payload_pts;
-        i_payload_pts = i_pkt_time + (mtime_t)i_pkt_time_delta * i_subpayload_count * 1000;
+        i_payload_pts = i_pkt_time + i_pkt_time_delta * i_subpayload_count;
         if ( p_tkinfo->p_sp )
             i_payload_pts -= MSFTIME_TO_MTIME(p_tkinfo->p_sp->i_time_offset);
 
-- 
2.17.0



More information about the vlc-devel mailing list