[FFmpeg-devel] Patch: file_seek() should not support AVSEEK_SIZE

avcoder ffmpeg
Mon Jan 4 13:46:29 CET 2010


On Mon, Jan 4, 2010 at 8:12 PM, Michael Niedermayer <michaelni at gmx.at>wrote:

> On Mon, Jan 04, 2010 at 11:14:51AM +0800, avcoder wrote:
> > Dear:
> >
> > file_seek() should ignore AVSEEK_SIZE operation
>
> what is calling it with that?
>

It is just a hack for HTTP--like protocol to act as a shortcut of getting
the file size,
url_fsize() alway passes AVSEEK_SIZE as whence to obtain file size:

int64_t url_fsize(ByteIOContext *s)
{
    int64_t size;

    if(!s)
        return AVERROR(EINVAL);

    if (!s->seek)
        return AVERROR(EPIPE);
    size = s->seek(s->opaque, 0, AVSEEK_SIZE);
    if(size<0){
        if ((size = s->seek(s->opaque, -1, SEEK_END)) < 0)
            return size;
        size++;
        s->seek(s->opaque, s->pos, SEEK_SET);
    }
    return size;
}


> and we cant list all int values that it should ignore
>
>
I agree, but  AVSEEK_SIZE is not a valid value for lseek(...)

-- 
-----------------------------------------------------------------------------------------
My key fingerprint: d1:03:f5:32:26:ff:d7:3c:e4:42:e3:51:ec:92:78:b2
Inspired by http://www.nextplayer.net. Your potential. Our passion.



More information about the ffmpeg-devel mailing list