[FFmpeg-devel] [PATCH] Replace ENOSYS by ENOTSUP
Ramiro Ribeiro Polla
ramiro
Tue Aug 7 04:19:49 CEST 2007
Michael Niedermayer wrote:
> Hi
>
> On Fri, Jul 20, 2007 at 03:54:16PM +0200, Panagiotis Issaris wrote:
>
>> Op 20-jul-07, om 10:10 heeft Panagiotis Issaris het volgende geschreven:
>>
>>
>>> Hi
>>>
>>> Op 19-jul-07, om 23:36 heeft Michael Niedermayer het volgende
>>> geschreven:
>>>
>>>
>>>> Hi
>>>>
>>>> On Thu, Jul 19, 2007 at 07:12:37PM +0200, Panagiotis Issaris wrote:
>>>>
>>>>> Hi
>>>>>
>>>>> Replace ENOSYS by ENOTSUP as in this case the problem is not
>>>>> really a function
>>>>> which is not available, but a media type which is not supported.
>>>>>
>>>> ok
>>>>
>>> Applied.
>>>
>> On #ffmpeg someone mentioned that Cygwin does not have ENOTSUP. Add a
>> define for it in os_support.h in case cygwin is used?
>>
>
> adding a
> #define ENOTSUP blah
> is not a solution for systems which lack ENOTSUP as the user app should be
> able to test for AVERROR(ENOTSUP) and lavc has no buisness with defining
> ENOTSUP in a public header ...
>
>
[1] has the errors and the according strerror() messages supported in
MinGW. It only implements error codes from msvcrt, so it has no business
defining ENOTSUP. And it seems to have no equivalent or similar error.
I've looked through where not-implemented/supported stuff return errors.
Some return -1, others ignore it, and some even assert(0). It's a mess
the way it is.
I agree with Takis that there should be more error codes. Not one for
every possible parameter, as was being discussed in [2], but rather a
few related to FFmpeg's development.
2 that come to mind would be:
AVERROR_NOTSUPP not supported because of limitation in standard/whatever.
AVERROR_NOTIMPL or AVERROR_NOTYET, for not yet implemented in FFmpeg.
(patches welcome =)
To avoid error number clashes, -MKTAG could be used with 4 letters that
indicate the error. It is very unlikely that an error on any system has
such a number. Attached patch is an example for this.
I want to make things compile properly again on MinGW. Is it a must that
POSIX errors are used?
Ramiro Polla
P.S: As a last resort we could return EAGAIN as in "try again with a
newer revision". (just kidding =).
[1]
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/winsup/mingw/include/errno.h?rev=1.8&cvsroot=src
[2] http://article.gmane.org/gmane.comp.video.ffmpeg.devel/54366
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ENOTSUP.diff
Type: text/x-patch
Size: 1060 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070806/afb05ef7/attachment.bin>
More information about the ffmpeg-devel
mailing list