[FFmpeg-devel] [PATCH 2/2] lavf: replace ETIMEDOUT by AVERROR_TIMEOUT

Michael Niedermayer michaelni at gmx.at
Tue Sep 4 18:33:10 CEST 2012


On Tue, Sep 04, 2012 at 06:20:18PM +0200, Nicolas George wrote:
> Le nonidi 19 fructidor, an CCXX, Michael Niedermayer a écrit :
> > ETIMEDOUT is not available on all systems and defining it in an internal
> > header to something does not help external applications interpreting the
> > error code. Thus its better we use our own error code, that can be used
> > everywhere.
> 
> Beware, on systems where ETIMEDOUT exists, it is a possible value for errno,
> so ff_neterrno() = AVERROR(errno) can return it. Therefore, ff_neterrno must
> be changed too, maybe something like that:
> 
> static inline int ff_neterrno(void)
> {
>     switch (errno) {
>     case ETIMEDOUT: return AVERROR_TIMEOUT;
>     default:        return AVERROR(errno);
>     }
> }

thats becoming messy, more so as there may be more cases (in the
future) that might need the remapping

I think, i tend to favor your original suggestion of using it just
for the one case or we could just return -1 there.
Either way the compile failure must be fixed the exact error code is
not so important IMHO, and can also be fixe later

    
[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The bravest are surely those who have the clearest vision
of what is before them, glory and danger alike, and yet
notwithstanding go out to meet it. -- Thucydides
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120904/13ff7134/attachment.asc>


More information about the ffmpeg-devel mailing list