[FFmpeg-devel] [PATCH] Replace ENOSYS by ENOTSUP

Michael Niedermayer michaelni
Wed Aug 8 19:08:32 CEST 2007


Hi

On Tue, Aug 07, 2007 at 08:50:48PM -0300, Ramiro Ribeiro Polla wrote:
> Hello,
>
> Michael Niedermayer wrote:
>> 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:
>>>>>         
> [...]
>>>>> 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 ...
>>
>>   
>
> Patch attached. I removed the underscore between PATCH and WELCOME, since 
> errors normally don't have underscores. I also added a slightly better 
> description. A grep for "implemented" and "supported" shows there are many 
> places this will need to be used =).
>
> A second patch makes use of this in vocenc.c and restores MinGW 
> compilation.

iam ok with the patches if noone has objections and noone has a better
idea

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The greatest way to live with honor in this world is to be what we pretend
to be. -- Socrates
-------------- 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/20070808/e9a08e1f/attachment.pgp>



More information about the ffmpeg-devel mailing list