[Ffmpeg-devel] Seeking with in an MPEGTS

Måns Rullgård mru
Tue Jun 21 15:46:39 CEST 2005


Andy Parkins said:
> Hello,
>
> As part of my search for this bug I've been looking in mpegts.c:read_seek()
> I think I've found a bug; rather than the loop searching for byte 1 of a
> packet to match 0x40 is it not better to simply call mpegts_resync() which
> will find the start of the next PES packet?  The patch below does just that.
>
> I'm not sure that I'm correct in this; because it may be that the seek is
> actually looking for the next start of payload packet (hence buf[1] & 0x40).

That is indeed what it's doing.

> However, even if I'm not I think that read_seek should at least resync before
> it goes looking for the start of payload - unless I've missed the part that
> ensures av_seek_binary() only returns on a TS boundary.

I think you missed that part.

-- 
M?ns Rullg?rd
mru at inprovide.com





More information about the ffmpeg-devel mailing list