[FFmpeg-devel] [PATCH 7/9] Replace AVERROR_NOTSUPP by AVERROR(ENOSYS)
Michael Niedermayer
michaelni
Thu Jul 19 22:28:45 CEST 2007
Hi
On Thu, Jul 19, 2007 at 07:22:00PM +0200, Panagiotis Issaris wrote:
> Hi
>
> Op 19-jul-07, om 18:57 heeft Michael Niedermayer het volgende
> geschreven:
>
> > Hi
> >
> > On Thu, Jul 19, 2007 at 06:42:06PM +0200, Panagiotis Issaris wrote:
> >> Hi
> >>
> >> Op 19-jul-07, om 17:55 heeft Michael Niedermayer het volgende
> >> geschreven:
> >>
> >>> Hi
> >>>
> >>> On Thu, Jul 19, 2007 at 05:37:48PM +0200, Panagiotis Issaris wrote:
> >>>> Hi
> >>>>
> >>>> Op 19-jul-07, om 17:30 heeft Michael Niedermayer het volgende
> >>>> geschreven:
> >>>>
> >>>>> Hi
> >>>>>
> >>>>> On Thu, Jul 19, 2007 at 02:55:22PM +0200, Panagiotis Issaris
> >>>>> wrote:
> >>>>>> The attached patch replaces all occurrances of AVERROR_NOTSUPP
> >>>>>> with
> >>>>>> AVERROR(ENOSYS).
> >>>>>
> >>>>> ok
> >>>>
> >>>> Applied.
> >>>
> >>> ok, also some of these AVERROR(ENOSYS) should be changed to AVERROR
> >>> (ENOTSUP)
> >>
> >>
> >> According to the OpenGroup website:
> >> [ENOSYS] Function not supported.
> >> [ENOTSUP] Not supported.
> >>
> >> It is not really clear to me where the difference lies; how would you
> >> interpret them?
> >>
> >> The manpages on my GNU/Linux system explain ENOTSUP as being
> >> "Operation not supported".
> >
> > info libc says:
> > -- Macro: int ENOSYS
> > Function not implemented. This indicates that the function
> > called
> > is not implemented at all, either in the C library itself or
> > in the
> > operating system. When you get this error, you can be sure that
> > this particular function will always fail with `ENOSYS' unless
> > you
> > install a new version of the C library or the operating system.
> >
> > -- Macro: int ENOTSUP
> > Not supported. A function returns this error when certain
> > parameter values are valid, but the functionality they request is
> > not available. This can mean that the function does not
> > implement
> > a particular command or option value or flag bit at all. For
> > functions that operate on some object given in a parameter, such
> > as a file descriptor or a port, it might instead mean that only
> > _that specific object_ (file descriptor, port, etc.) is unable to
> > support the other parameters given; different file descriptors
> > might support different ranges of parameter values.
> >
> > If the entire function is not available at all in the
> > implementation, it returns `ENOSYS' instead.
> >
> > note, i do not know if this is GNUs, POSIXs, ISOs or whoever elses
> > definition
> >
>
> I see. Thanks for the information!
>
> Related to this: As I've mentioned before on this list, one of the
> things
> I'd like to change in libavcodec is the handling of errors. I'd like
> returncodes indicating failure to carry information about the cause
> of the
> failure. So, for example, in the case of mpegvideo_enc.c, I'd prefer to
> see MPV_encode_init() return different errorcodes for different kinds of
> failures occurring instead of the currently used "return -1;" for all
> errors.
>
> I'm not sure about the granularity though...
>
> Would something like this be nice & useful?
>
> #define AVERROR_PIXFMT_NOTSUP <somevalue>
> #define AVERROR_BFRAMES_NOTSUP <somevalue+1>
> #define AVERROR_RC_PARSE_ERROR <somevalue+2>
> ...
whats the sense of this?
an application which has code to parse these and do some appropriate
action beyond printing an error message can as well just contain code
to set the values properly in the first place
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Good people do not need laws to tell them to act responsibly, while bad
people will find a way around the laws. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070719/ce6cbe01/attachment.pgp>
More information about the ffmpeg-devel
mailing list