[FFmpeg-devel] [PATCH] Replace ENOSYS by ENOTSUP
Michael Niedermayer
michaelni
Tue Aug 7 18:08:47 CEST 2007
Hi
On Mon, Aug 06, 2007 at 11:19:49PM -0300, Ramiro Ribeiro Polla wrote:
> 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 =)
why not AVERROR_PATCH_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.
iam ok with the -MKTAG idea
[...]
> Index: libavcodec/avcodec.h
> ===================================================================
> --- libavcodec/avcodec.h (revision 9973)
> +++ libavcodec/avcodec.h (working copy)
> @@ -2934,6 +2934,7 @@
> #define AVERROR_NOMEM AVERROR(ENOMEM) /**< not enough memory */
> #define AVERROR_NOFMT AVERROR(EILSEQ) /**< unknown format */
> #define AVERROR_NOTSUPP AVERROR(ENOSYS) /**< Operation not supported. */
> +#define AVERROR_NOTIMPL -MKTAG('N','I','M','P') /**< Not implemented in FFmpeg */
i think the description is a little terse ...
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Republics decline into democracies and democracies degenerate into
despotisms. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070807/eec2fd90/attachment.pgp>
More information about the ffmpeg-devel
mailing list