Merge commit '74972220909787af5a3ffe66f7fa8041827c2bd2'
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 30 Jul 2013 09:51:14 +0000 (11:51 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 30 Jul 2013 09:51:14 +0000 (11:51 +0200)
* commit '74972220909787af5a3ffe66f7fa8041827c2bd2':
  rtpproto: Support more than one SSM include address, support excludes

Conflicts:
libavformat/rtpproto.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavformat/rtpproto.c

@@@ -150,9 -170,50 +170,51 @@@ static void build_udp_url(char *buf, in
          url_add_option(buf, buf_size, "pkt_size=%d", max_packet_size);
      if (connect)
          url_add_option(buf, buf_size, "connect=1");
-     if (sources && sources[0])
-         url_add_option(buf, buf_size, "sources=%s", sources);
 +    url_add_option(buf, buf_size, "fifo_size=0");
+     if (include_sources && include_sources[0])
+         url_add_option(buf, buf_size, "sources=%s", include_sources);
+     if (exclude_sources && exclude_sources[0])
+         url_add_option(buf, buf_size, "block=%s", exclude_sources);
+ }
+ static void rtp_parse_addr_list(URLContext *h, char *buf,
+                                 struct sockaddr_storage ***address_list_ptr,
+                                 int *address_list_size_ptr)
+ {
+     struct addrinfo *ai = NULL;
+     struct sockaddr_storage *source_addr;
+     char tmp = '\0', *p = buf, *next;
+     /* Resolve all of the IPs */
+     while (p && p[0]) {
+         next = strchr(p, ',');
+         if (next) {
+             tmp = *next;
+             *next = '\0';
+         }
+         ai = rtp_resolve_host(p, 0, SOCK_DGRAM, AF_UNSPEC, 0);
+         if (ai) {
+             source_addr = av_mallocz(sizeof(struct sockaddr_storage));
+             if (!source_addr)
+                 break;
+             memcpy(source_addr, ai->ai_addr, ai->ai_addrlen);
+             freeaddrinfo(ai);
+             dynarray_add(address_list_ptr, address_list_size_ptr, source_addr);
+         } else {
+             av_log(h, AV_LOG_WARNING, "Unable to resolve %s\n", p);
+         }
+         if (next) {
+             *next = tmp;
+             p = next + 1;
+         } else {
+             p = NULL;
+         }
+     }
  }
  
  /**