[vlc-devel] [PATCH 07/16] demux:asf: fix incorrect conversion i_time_offset in DemuxPayload()

Francois Cartegnie fcvlcdev at free.fr
Thu Jun 7 12:59:36 CEST 2018


Le 07/06/2018 à 12:55, Steve Lhomme a écrit :

>>>             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.
> _______________________________________________

ok, misread other macro

+#define MS_TO_MTIME(ms) ((ms) * (CLOCK_FREQ / 1000))

-- 
Francois Cartegnie
VideoLAN - VLC Developer


More information about the vlc-devel mailing list