[Ffmpeg-devel] Re: [PATCH] seeking in GXF

Baptiste Coudurier baptiste.coudurier
Mon Jul 31 15:05:04 CEST 2006


Hi

Reimar D?ffinger wrote:
> Hello,
> attached patch add seeking for gxf files (both with and without index).
> It probably still contains some bad/ugly code, but I can't think clearly
> anymore today. So if someone can have a look or test it, please do so.
> Btw. is there some kind of flag to for libavformat not to use the index
> in a file and resolve to generic seeking instead?
> 
> Greetings,
> Reimar D?ffinger
> 
> [...]
>
> +        st->time_base.num = si.frames_per_second.den;
> +        st->time_base.den = si.frames_per_second.num * si.fields_per_frame;
> +        if (!main_timebase.den || !main_timebase.num)
> +            main_timebase = st->time_base;
> +        if (si.first_field >= 0) {
> +            st->start_time = si.first_field;
> +            if (si.last_field >= 0)
> +                st->duration = si.last_field - si.first_field;
> +        }
>      }
>      if (len < 0)
>          av_log(s, AV_LOG_ERROR, "GXF: invalid track description length specified\n");
>      if (map_len)
>          url_fskip(pb, map_len);
> +    if (main_timebase.num && main_timebase.den) {
> +        int i;
> +        for (i = 0; i < s->nb_streams; i++) {
> +            st = s->streams[i];
> +            if (!st->time_base.num || !st->time_base.den)
> +                st->time_base = main_timebase;
> +        }
> +    }
>      return 0;
>  }

I think st->time_base might need a check for 0. I get floating point
exception on sample without fps track tag.

Other than that, seeking works pretty well on my samples.

Btw, I think there is also a problem with last audio packet, which might
not contain 32768 samples in uncompressed: last field in MEDIA_PKT will
be less and that must be taken into account while reading. Atm I can
hear glitches on last packet, I'll look at it

-- 
Baptiste COUDURIER                              GnuPG Key Id: 0x5C1ABAAA
SMARTJOG S.A.                                    http://www.smartjog.com
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
Phone: +33 1 49966312




More information about the ffmpeg-devel mailing list