[Ffmpeg-cvslog] r6316 - trunk/libavformat/aviobuf.c

Baptiste Coudurier baptiste.coudurier
Thu Oct 19 11:01:47 CEST 2006


Hi

michael wrote:
> Author: michael
> Date: Fri Sep 22 12:03:04 2006
> New Revision: 6316
> 
> Modified:
>    trunk/libavformat/aviobuf.c
> 
> Log:
> simplify url_fseek()
> 
> 
> Modified: trunk/libavformat/aviobuf.c
> ==============================================================================
> --- trunk/libavformat/aviobuf.c	(original)
> +++ trunk/libavformat/aviobuf.c	Fri Sep 22 12:03:04 2006
> @@ -106,56 +106,41 @@
>  offset_t url_fseek(ByteIOContext *s, offset_t offset, int whence)
>  {
>      offset_t offset1;
> +    offset_t pos= s->pos - (s->write_flag ? 0 : (s->buf_end - s->buffer));
>  
>      if (whence != SEEK_CUR && whence != SEEK_SET)
>          return -EINVAL;
>  
> +    if (whence == SEEK_CUR) {
> +        offset1 = pos + (s->buf_ptr - s->buffer);
> +        if (offset == 0)
> +            return offset1;
> +        offset += offset1;
> +    }

This commit broke url_ftell when ByteIOContext was used with memory like
in mov.c, see showdown2.mov which contains 'cmov' and does not work
anymore since url_ftell(pb) return negative value. (s->pos == 0, and
buf_end was manually set to the end for buffer)

Using memory with ByteIOContext is a bit hackish though.

-- 
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-cvslog mailing list