[FFmpeg-devel] [PATCH] lavf: add subfile protocol.

Lukasz M lukasz.m.luki at gmail.com
Thu Feb 27 19:34:52 CET 2014


On 27 February 2014 19:27, Nicolas George <george at nsup.org> wrote:

> Le nonidi 9 ventôse, an CCXXII, Lukasz Marek a écrit :
> > In file protocol lseek is used. If you pass SEEK_SET and n as new
> > pos it always returns n and errno = 0. Even when seeking beyond end
> > of the file or before beginning.  When you look at code file.c it
> > will return 0 in case seeking to position before beginning.
>
> I think you read the code wrong. In the file protocol, as you say, lseek is
> used, and it returns whatever lseek returns.


but when lseek returns negative, AVERROR(errno) is return and I get always
0.


> After your first mail, I
> checked in the specs, and I just re-checked by experiment: both confirm
> that
> seeking below 0 is not legal and just fails with EINVAL.

Seeking past the end of the file is legal, although useless for reading.
>
> I therefore believe this part of the patch is fine.
>

I saw same specs says that explicitly it is an error, some not.
I made experiment too and no error by errno was reported.
It is ok with me, just noted that.


More information about the ffmpeg-devel mailing list