[FFmpeg-devel] [PATCH 1/6] Return meaningful error codes, rather than always -1.
Luca Abeni
lucabe72
Mon Apr 26 00:06:43 CEST 2010
On Sun, 2010-04-25 at 20:32 +0200, Stefano Sabatini wrote:
[...]
> > > I was unsure between this and EPERM = "Operation not permitted".
> > >
> > > EPERM = -1 so it should be safe to just replace -1 with
> > > AVERROR(EPERM), would that be fine?
> >
> > Not for that reason. This is certainly not a problem of lack of
> > permissions. Capturing from something which is not a capture device
> > is impossible no matter what permissions you have. How about ENODEV?
>
> From:
> http://www.opengroup.org/onlinepubs/000095399/functions/xsh_chap02_03.html
>
> [ENODEV] No such device. An attempt was made to apply an inappropriate
> function to a device; for example, trying to read a write-only device
> such as a printer.
I think ENODEV is the best option, here
Luca
More information about the ffmpeg-devel
mailing list