[vlc-devel] [PATCH 07/16] demux:asf: fix incorrect conversion i_time_offset in DemuxPayload()
Steve Lhomme
robux4 at ycbcr.xyz
Thu Jun 7 12:55:16 CEST 2018
On 2018-06-07 12:38 PM, Francois Cartegnie wrote:
> Le 07/06/2018 à 11:59, Steve Lhomme a écrit :
>> i_time_offset is an msftime_t
>> ---
>> modules/demux/asf/asfpacket.c | 4 ++--
>> modules/demux/asf/libasf.h | 2 +-
>> 2 files changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/modules/demux/asf/asfpacket.c b/modules/demux/asf/asfpacket.c
>> index cbcf2bab0e..3167c7d2ea 100644
>> --- a/modules/demux/asf/asfpacket.c
>> +++ b/modules/demux/asf/asfpacket.c
>> @@ -337,12 +337,12 @@ static int DemuxPayload(asf_packet_sys_t *p_packetsys, asf_packet_t *pkt, int i_
>> mtime_t i_payload_pts;
>> i_payload_pts = i_pkt_time + (mtime_t)i_pkt_time_delta * i_subpayload_count * 1000;
>> if ( p_tkinfo->p_sp )
>> - i_payload_pts -= p_tkinfo->p_sp->i_time_offset * 10;
>> + i_payload_pts -= MSFTIME_TO_MTIME(p_tkinfo->p_sp->i_time_offset);
>>
>> mtime_t i_payload_dts = i_pkt_time;
>>
>> if ( p_tkinfo->p_sp )
>> - i_payload_dts -= p_tkinfo->p_sp->i_time_offset * 10;
>> + i_payload_dts -= MSFTIME_TO_MTIME(p_tkinfo->p_sp->i_time_offset);
>>
> I don't see how 100 nanoseconds can become microseconds with x1000
i_payload_dts is in mtime_t (microsecond), i_time_offset in msftime_t
(100ns) and MSFTIME_TO_MTIME() effectively does / 10 on the value. The
original conversion was wrong.
If you're talking about the *1000 above that's unrelated to this. That's
because i_pkt_time_delta is in ms (see 16/16). mtime_t is microseconds
and should always be read/write that way.
More information about the vlc-devel
mailing list