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

elupus elupus
Sat May 24 13:28:42 CEST 2008

On Sat, 24 May 2008 13:01:27 +0200, Michael Niedermayer wrote:

> 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!

Right, luckily this turned out easy now that the resync wasn't required
anymore. So only two patches, one making the demuxer add index entries on
read. And the other the read_timestamp code.

>> 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
> behavior.

So you are saying checking this is uneccesary cause stream position isn't
allowed to change outside demuxer? 
In that case i will ditch that extra state and dump the resync from the
reading code.

>> 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?
> probably

Good, makes code a lil bit simpler.

So, here's an updated patch. Might add support for reading full index
contained in some nuv files later. Still, this patch in combination with
the duration reading patch fixes most issues seeking in nuv files.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: nuv_index.patch
Type: text/x-patch
Size: 923 bytes
Desc: Attached file: nuv_index.patch
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080524/db781351/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nuv_timestamp.patch
Type: text/x-patch
Size: 3546 bytes
Desc: Attached file: nuv_timestamp.patch
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080524/db781351/attachment-0001.bin>

More information about the ffmpeg-devel mailing list