On Thu, Nov 24, 2011 at 05:37:19PM +0100, Luca Barbato wrote:
> Please do not use it yet for anything serious, error handling and socket
> tracking is missing
> ---
> libavformat/Makefile | 1 +
> libavformat/allformats.c | 1 +
> libavformat/sctp.c | 180
> ++++++++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 182 insertions(+), 0 deletions(-)
Changelog update missing.
> --- a/libavformat/Makefile
> +++ b/libavformat/Makefile
> @@ -337,6 +337,7 @@ OBJS-$(CONFIG_RTMP_PROTOCOL) +=
> $(RTMP-OBJS-yes)
> OBJS-$(CONFIG_RTP_PROTOCOL) += rtpproto.o
> OBJS-$(CONFIG_TCP_PROTOCOL) += tcp.o
> OBJS-$(CONFIG_TLS_PROTOCOL) += tls.o
> +OBJS-$(CONFIG_UDP_PROTOCOL) += sctp.o
> OBJS-$(CONFIG_UDP_PROTOCOL) += udp.o
Duplicate entry - or did you mean to write CONFIG_SCTP_PROTOCOL?
> --- a/libavformat/allformats.c
> +++ b/libavformat/allformats.c
> @@ -258,4 +258,5 @@ void av_register_all(void)
> REGISTER_PROTOCOL (TCP, tcp);
> REGISTER_PROTOCOL (TLS, tls);
> REGISTER_PROTOCOL (UDP, udp);
> + REGISTER_PROTOCOL (SCTP, sctp);
order
> --- /dev/null
> +++ b/libavformat/sctp.c
> @@ -0,0 +1,180 @@
> +#include "avformat.h"
> +#include <unistd.h>
> +#include "internal.h"
> +#include "network.h"
> +#include "os_support.h"
> +#if HAVE_POLL_H
> +#include <poll.h>
> +#endif
> +#include <sys/time.h>
> +#include <netinet/sctp.h>
system headers before local headers
> +static int sctp_open(URLContext *h, const char *uri, int flags)
> +{
> + struct addrinfo hints, *ai, *cur_ai;
> +
> + memset(&hints, 0, sizeof(hints));
You could initialize hints to 0 instead.
> + if(flags & URL_WRONLY) {
> + ret = connect(fd, cur_ai->ai_addr, cur_ai->ai_addrlen);
if (
> +URLProtocol ff_sctp_protocol = {
> + "sctp",
> + sctp_open,
> + sctp_read,
> + sctp_write,
> + NULL, /* seek */
> + sctp_close,
> + .url_get_file_handle = sctp_get_file_handle,
> +};
designated initializers
Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel