#include <string.h>
#include "libavutil/avstring.h"
#include "libavutil/base64.h"
+#include "libavutil/parseutils.h"
#include "libavcodec/xiph.h"
#include "avformat.h"
#include "internal.h"
if (dest_addr) {
if (!dest_type)
dest_type = "IP4";
- if (ttl > 0) {
+ if (ttl > 0 && !strcmp(dest_type, "IP4")) {
+ /* The TTL should only be specified for IPv4 multicast addresses,
+ * not for IPv6. */
av_strlcatf(buff, size, "c=IN %s %s/%d\r\n", dest_type, dest_addr, ttl);
} else {
av_strlcatf(buff, size, "c=IN %s %s\r\n", dest_type, dest_addr);
#if CONFIG_NETWORK
static int resolve_destination(char *dest_addr, int size, char *type,
- int type_size)
+ int type_size)
{
struct addrinfo hints, *ai;
int is_multicast;
return 0;
getnameinfo(ai->ai_addr, ai->ai_addrlen, dest_addr, size,
NULL, 0, NI_NUMERICHOST);
+#ifdef AF_INET6
if (ai->ai_family == AF_INET6)
av_strlcpy(type, "IP6", type_size);
+#endif
is_multicast = ff_is_multicast_address(ai->ai_addr);
freeaddrinfo(ai);
return is_multicast;
}
#else
static int resolve_destination(char *dest_addr, int size, char *type,
- int type_size)
+ int type_size)
{
return 0;
}
if (p) {
char buff[64];
- if (find_info_tag(buff, sizeof(buff), "ttl", p)) {
- *ttl = strtol(buff, NULL, 10);
- } else {
- *ttl = 5;
- }
+ if (av_find_info_tag(buff, sizeof(buff), "ttl", p)) {
+ *ttl = strtol(buff, NULL, 10);
+ } else {
+ *ttl = 5;
+ }
}
return port;
break;
case CODEC_ID_H263:
case CODEC_ID_H263P:
- av_strlcatf(buff, size, "a=rtpmap:%d H263-2000/90000\r\n", payload_type);
+ /* a=framesize is required by 3GPP TS 26.234 (PSS). It
+ * actually specifies the maximum video size, but we only know
+ * the current size. This is required for playback on Android
+ * stagefright and on Samsung bada. */
+ av_strlcatf(buff, size, "a=rtpmap:%d H263-2000/90000\r\n"
+ "a=framesize:%d %d-%d\r\n",
+ payload_type,
+ payload_type, c->width, c->height);
break;
case CODEC_ID_MPEG4:
if (c->extradata_size) {