[FFmpeg-devel] [patch 3/3] Make timing calculations less dependant on start_time being defined.
Michael Niedermayer
michaelni
Sat Aug 25 23:18:47 CEST 2007
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
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
I am the wisest man alive, for I know one thing, and that is that I know
nothing. -- Socrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070825/6a597b78/attachment.pgp>
More information about the ffmpeg-devel
mailing list