[FFmpeg-devel] [RFC] The meaning of AVERROR_NOTSUPP

Stefano Sabatini stefano.sabatini-lala
Sat Mar 27 11:57:51 CET 2010


On date Saturday 2010-03-27 02:17:04 +0100, Michael Niedermayer encoded:
> On Sat, Mar 27, 2010 at 12:51:13AM +0100, Stefano Sabatini wrote:
[...]
> > Currently we have just one use of AVERROR_NOTSUPP:
> > 
> > in libavformat/file.c:
> > static int64_t file_seek(URLContext *h, int64_t pos, int whence)
> > {
> >     int fd = (intptr_t) h->priv_data;
> >     if (whence != SEEK_SET && whence != SEEK_CUR && whence != SEEK_END)
> >         return AVERROR_NOTSUPP;
> >     return lseek(fd, pos, whence);
> > }
> > 
> > This suggests the interpretation of AVERROR_NOTSUPP as "Operation
> > non-valid or illegal".
> 
> no, this interpretation is wrong
> the 4th case for getting the filesize is surely not an invalid or illegal
> operation for a file.

I believe in this case it is just better to let lseek manages the
error for that parameter, see patch.

Regards.
-- 
FFmpeg = Friendly and Faithful Merciful Portentous Esoteric Gadget



More information about the ffmpeg-devel mailing list