[FFmpeg-devel] [PATCH] Seeking and resync support in nuv demuxer

Michael Niedermayer michaelni
Sat May 24 13:01:27 CEST 2008

On Sat, May 24, 2008 at 11:16:57AM +0200, elupus wrote:
> Hi,
> Here is a patch too support seeking in nuv files. It adds index generation,
> read_timestamp and arbitrary postion resync support.

When you need the word "and" in a patch description you can be pretty sure
that you did something wrong. One patch for one seperate issue!

> To notice if a stream resync is required 

> (input stream location changed
> outside demuxer),

If you do this you will have undefined behavior. And you do have undefined

> it stores a stream position on each read. Also since
> resync positions in nuv files are quite scarce, it also considers all
> indexed locations as valid.

> I noticed something odd while doing this patch. What is packet.pos supposed
> to mean. In the nuv demuxer it means where in the stream the payload part
> of a demuxpacket starts. This position is not a position where reading can
> start as the header must be read first. So shouldn't the pkt.pos mean the
> location where the header for the packet starts?


> Also too speed up seeks using av_seek_frame_binary, I added index entries
> when a timestamp is found using read_timestamp. However wouldn't it be
> better to add this to av_seek_frame_binary? perhaps only when
> AVFMT_GENERIC_INDEX is set in format.

If you can simplify the code without breaking it that is welcome.

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Complexity theory is the science of finding the exact solution to an
approximation. Benchmarking OTOH is finding an approximation of the exact
-------------- 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/20080524/24e9cbcd/attachment.pgp>

More information about the ffmpeg-devel mailing list