]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/sctp.c
riff: add "GXVE" FourCC for WMV2
[ffmpeg] / libavformat / sctp.c
index 7bcb5ae0a9ffa8e3228dc37da0dcb2540cb87d24..66b31ccec691804f8e027aeb30551d8364e676fb 100644 (file)
 
 /*
  * The sctp_recvmsg and sctp_sendmsg functions are part of the user
- * library that offers support
- * for the SCTP kernel Implementation. The main purpose of this
- * code is to provide the SCTP Socket API mappings for user
- * application to interface with the SCTP in kernel.
+ * library that offers support for the SCTP kernel Implementation.
+ * To avoid build-time clashes the functions sport an ff_-prefix here.
+ * The main purpose of this code is to provide the SCTP Socket API
+ * mappings for user applications to interface with SCTP in the kernel.
  *
  * This implementation is based on the Socket API Extensions for SCTP
  * defined in <draft-ietf-tsvwg-sctpsocket-10.txt>
@@ -170,8 +170,12 @@ static int sctp_open(URLContext *h, const char *uri, int flags)
 
     av_url_split(proto, sizeof(proto), NULL, 0, hostname, sizeof(hostname),
                  &port, path, sizeof(path), uri);
-    if (strcmp(proto,"sctp") || port <= 0 || port >= 65536)
+    if (strcmp(proto, "sctp"))
         return AVERROR(EINVAL);
+    if (port <= 0 || port >= 65536) {
+        av_log(s, AV_LOG_ERROR, "Port missing in uri\n");
+        return AVERROR(EINVAL);
+    }
 
     s->max_streams = 0;
     p = strchr(uri, '?');
@@ -194,7 +198,7 @@ static int sctp_open(URLContext *h, const char *uri, int flags)
 
     cur_ai = ai;
 
-    fd = socket(cur_ai->ai_family, SOCK_STREAM, IPPROTO_SCTP);
+    fd = ff_socket(cur_ai->ai_family, SOCK_STREAM, IPPROTO_SCTP);
     if (fd < 0)
         goto fail;