[FFmpeg-devel] [PATCH] fix seeking and index generation

Michael Niedermayer michaelni
Wed Aug 25 16:04:06 CEST 2010


On Wed, Aug 25, 2010 at 12:35:31PM +0200, Michael Chinen wrote:
> On Tue, Aug 24, 2010 at 9:06 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
> [...]
> >> --- a/libavformat/utils.c
> >> +++ b/libavformat/utils.c
> >> @@ -1043,6 +1043,12 @@ static int av_read_frame_internal(AVFormatContext *s, AVPacket *pkt)
> >> ? ? ? ? ?/* select current input stream component */
> >> ? ? ? ? ?st = s->cur_st;
> >> ? ? ? ? ?if (st) {
> >> + ? ? ? ? ? ?if(st->parser && (st->parser->flags & PARSER_FLAG_FETCH_OFFSET) &&
> >> + ? ? ? ? ? ? ? (s->iformat->flags & AVFMT_GENERIC_INDEX)) {
> >> + ? ? ? ? ? ? ? ?st->parser->next_frame_offset =
> >> + ? ? ? ? ? ? ? ?st->parser->cur_offset ? ? ? ?= st->cur_pkt.pos;
> >> + ? ? ? ? ? ? ? ?st->parser->flags ^= PARSER_FLAG_FETCH_OFFSET;
> >> + ? ? ? ? ? ?}
> >
> > fliping the meaning of PARSER_FLAG_FETCH_OFFSET should simplify the code
> > also the existing and this can be factored i guess
> 
> I'm sorry but I'm not sure how to simply things by flipping the
> meaning of the flag.  In any case, there is now two points in util.c

if(!(s->flags & PARSER_FLAG_FETCHED_OFFSET) {
    s->next_frame_offset =
        s->cur_offset    = pos;
    s->flags |= PARSER_FLAG_FETCHED_OFFSET;
}

i dont know if this can be merged into some other code to simplify it
further

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Asymptotically faster algorithms should always be preferred if you have
asymptotical amounts of data
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100825/a6f08a80/attachment.pgp>



More information about the ffmpeg-devel mailing list