[FFmpeg-devel] [patch 3/3] Make timing calculations less dependant on start_time being defined.
Benoit Fouet
benoit.fouet
Wed Aug 29 16:42:51 CEST 2007
Benoit Fouet wrote:
> Michael Niedermayer wrote:
>
>> Hi
>>
>> On Sat, Aug 25, 2007 at 08:45:50AM +1000, Neil Brown wrote:
>>
>>
>>> On Friday August 24, michaelni at gmx.at wrote:
>>>
>>>
>>>>> I'm having a hard time understanding the point of some of (well... all
>>>>> of) the code in update_initial_timestamps.
>>>>>
>>>>>
>>>> its very simple, av_find_stream_info() analyses a input file/stream and
>>>> buffers all packets which it had to read (so that theres no need to seek
>>>> back after av_find_stream_info() which with pipes would be impossible)
>>>>
>>>> update_initial_timestamps() updates the timestamps of these buffered
>>>> packets in the case that the packets had no timestamp (that is libavformat
>>>> used the framerate / AVPacket.duration to set timestamps starting from a
>>>> arbitrary (=0) timestamt)
>>>>
>>>>
>>> Ahhhh... I get it now. All the time stamps are being offset by
>>> dts - st->cur_dts
>>>
>>> That makes sense. Thanks.
>>>
>>>
>>>
>>>> the first packet with a timestamp gets put in the buffer after
>>>> update_initial_timestamps() is called thus if theres nothing in the buffer
>>>> the code to set start_time fails ...
>>>> solution seems to be to pass pkt->pts in addition to dts into
>>>> update_initial_timestamps() and then add an additional check to use that
>>>> if no packet in the buffer had a pts value
>>>>
>>>>
>>> So this patch maybe (which also appears to fix my problem).
>>>
>>>
>> patch looks ok
>>
>> [...]
>>
>>
>
> Neil, please attach your patches to your mails and generate your diffs
> so that the patches can be applied with patch -p0 or -p1, thanks.
>
> also, libav tests reference file needs an update...
> see attached patch
>
>
ping ?
is the regression reference file's diff ok ?
--
Ben
Purple Labs S.A.
www.purplelabs.com
More information about the ffmpeg-devel
mailing list