[FFmpeg-devel] [PATCH] Fix MPEG-TS seek and frame positions in general

Michael Niedermayer michaelni
Tue Feb 10 13:12:37 CET 2009

On Tue, Feb 10, 2009 at 11:28:01AM +0100, Ivan Schreter wrote:
> Michael Niedermayer wrote:
> > On Mon, Feb 09, 2009 at 01:35:58AM +0100, Ivan Schreter wrote:
> >   
> >>
> >> So here we go, patch #4 attached.
> >>     
> >
> > ive looked more at it and it looks very wrong
> > the newly added variable is a duplicate of cur_pkt.pos and you override
> > the use of cur_pkt.pos at some places with it.
> > i suspect that moving got_packet: up one line has the same effect as your
> > rather bloated patch
> >
> >   
> Maybe it looks wrong to you, but I still believe it's very right.
> Moving the label one line up will address only the case where frame is 
> completely contained in one packet (where current code sets no position 

right, sorry, current code is broken no matter where that label is.
but yours still is nowhere near correct

the time when a frame end/start is detected can be several packets after
the point where the first byte of that frame was stored.
the obvious way to fix this is to pass pos into av_parser_parse()
and reorder it like the timestamps.

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I have often repented speaking, but never of holding my tongue.
-- Xenocrates
-------------- 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/20090210/c882f6aa/attachment.pgp>

More information about the ffmpeg-devel mailing list