[FFmpeg-devel] r22718 in libavformat/rtsp.c uses non-portable errno

Ramiro Polla ramiro.polla
Sat Apr 10 19:40:04 CEST 2010


On Sat, Apr 10, 2010 at 2:20 PM, Ronald S. Bultje <rsbultje at gmail.com> wrote:
> On Apr 10, 2010, at 12:56 PM, Ramiro Polla <ramiro.polla at gmail.com> wrote:
>
>> On Fri, Apr 2, 2010 at 7:51 PM, Ramiro Polla <ramiro.polla at gmail.com>
>> wrote:
>>>
>>> On Fri, Apr 2, 2010 at 5:15 PM, Ronald S. Bultje <rsbultje at gmail.com>
>>> wrote:
>>>>
>>>> On Fri, Apr 2, 2010 at 4:09 PM, Sam Gerstein <sgerstein at bluefinlab.com>
>>>> wrote:
>>>>>
>>>>> On Thu, Apr 1, 2010 at 10:27 AM, Tom Evans <tevans.uk at googlemail.com>
>>>>> wrote:
>>>>>>
>>>>>> This change introduces a use of ETIME, which as far as I can tell, is
>>>>>> a non-portable error number (it certainly isn't available in FreeBSD).
>>>>>>
>>>>>> Could this be replaced with a different errno? Perhaps ETIMEDOUT ?
>>>>>
>>>>> I see only now that ETIME is officially optional- agreed, change it to
>>>>> ETIMEDOUT. ?Patch attached! ?Apologies for that.
>>>>
>>>> Applied.
>>>>
>>>> Can the Windows / cygwin people please generate a patch against
>>>> os_support.h to add this as a WSA define?
>>>
>>> Why is this not a network error?
>>> - ? ? ? ? ? ?return AVERROR(ETIMEDOUT);
>>> + ? ? ? ? ? ?return AVERROR(FF_NETERROR(ETIMEDOUT));
>>
>> May I just commit this to restore compilation on MinGW while we don't
>> reach an agreement on whether FF_NETERROR should automatically be an
>> AVERROR?
>
> I was waiting for you to tell me it fixex the bug.

Oh, I missed that...

With your patch and
Index: rtsp.c
===================================================================
--- rtsp.c	(revision 22828)
+++ rtsp.c	(working copy)
@@ -1583,7 +1583,7 @@
             goto fail;
         lower_transport_mask &= ~(1 << lower_transport);
         if (lower_transport_mask == 0 && err == 1) {
-            err = AVERROR(FF_NETERROR(EPROTONOSUPPORT));
+            err = FF_NETERROR(EPROTONOSUPPORT);
             goto fail;
         }
     } while (err);
the output of rtsp.o is binary identical to my patch.

There's also another occurrence in cmdutils.c, and I think we should
enclose the error with (), such as
-#define ff_neterrno() WSAGetLastError()
-#define FF_NETERROR(err) WSA##err
+#define ff_neterrno() (-WSAGetLastError())
+#define FF_NETERROR(err) (-WSA##err)

Ramiro Polla



More information about the ffmpeg-devel mailing list