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

elupus elupus
Sun Jun 8 21:32:36 CEST 2008


On Sat, 7 Jun 2008 19:40:18 +0200, Reimar D?ffinger wrote:

> 
> Should something like
> uint32_t tag = 0;
> while (...) {
>   tag = (tag << 8) | get_byte(pb);
>   if (                 tag == MKBETAG('R','T','j','j') &&
>       (tag = get_be32(pb)) == MKBETAG('j','j','j','j') &&
>       (tag = get_be32(pb)) == MKBETAG('j','j','j','j'))
>     return 1;
> }
> 
> can maybe be done less ugly, but it should not be much more code than
> this, and in particular I am against continues, breaks etc. unless they
> decidedly simplify the code.

Ok, modified.

> 
>> +                // TODO - add general support in av_gen_search, so it adds positions after reading timestamps
> 
> I have the feeling there is a very good reason why this is not done.
> At least that it leads to a very partial index seems "dangerous" to me.
> 
>> +                av_add_index_entry(s->streams[frametype == NUV_VIDEO ? ctx->v_id : ctx->a_id]
>> +                                 , pos, dts, size + HDRSIZE, 0, hdr[2] == 0 ? AVINDEX_KEYFRAME : 0);
> 
> And either way I really think this should not be done here at least.

So will you accept it with that still in? It speeds up seeking by alot. And
before gen_seek is modified, it makes sence to have this here. 

Joakim
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-Add-read_timestamp-to-nuv-demuxer-so-general-seeking.patch
Type: text/x-patch
Size: 3150 bytes
Desc: Attached file: 0004-Add-read_timestamp-to-nuv-demuxer-so-general-seeking.patch
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080608/7b62d2e6/attachment.bin>



More information about the ffmpeg-devel mailing list