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

Anshul anshul.ffmpeg at gmail.com
Thu Feb 27 20:55:13 CET 2014



Lukasz M <lukasz.m.luki at gmail.com> wrote:
>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.
>_______________________________________________
>ffmpeg-devel mailing list
>ffmpeg-devel at ffmpeg.org
>http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Would it be good to mention the heuristic behavior of seek beyond end in our seek example?
Atleast to me it was surpriseing.

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.


More information about the ffmpeg-devel mailing list