[FFmpeg-devel] [PATCH 12/12] asfdec: read the index while reading the header, not on first seek

Vladimir Pantelic vladoman
Thu Feb 10 09:35:42 CET 2011


Anton Khirnov wrote:
> it makes more sense and gets rid of a variable from ASFContext.
>
> asf_build_simple_index() is changed to use ASFContext.data_ofsset
> instead of AVFormatContext.data_offset, since the latter isn't set yet.
> ---
>   libavformat/asfdec.c |  136 ++++++++++++++++++++++++--------------------------
>   1 files changed, 66 insertions(+), 70 deletions(-)
>
>   static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap)
>   {
>       ASFContext *asf = s->priv_data;
> @@ -650,6 +712,8 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap)
>       asf->data_offset = url_ftell(pb);
>       asf->packet_size_left = 0;
>
> +    if (!(url_is_streamed(s->pb) || s->flags&  AVFMT_FLAG_IGNIDX))
> +        asf_build_simple_index(s);
>
>       for(i=0; i<128; i++){
>           int stream_num= asf->asfid2avid[i];
> @@ -1145,73 +1209,8 @@ static int64_t asf_read_pts(AVFormatContext *s, int stream_index, int64_t *ppos,
>       return pts;
>   }

will that not make startup time longer on a "slow" link?




More information about the ffmpeg-devel mailing list