aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJernej Virag <jernej@virag.si>2012-12-17 10:04:15 +0100
committerMartin Storsjö <martin@martin.st>2012-12-20 12:37:34 +0200
commite30e8e311e14236a979ce061538ec8b8bad8655f (patch)
treeffa8f49f31a7e2d410f86353618dc863e3fea0bf
parentb2fe6756e34d1316d0fa799e8a5ace993059c407 (diff)
downloadffmpeg-e30e8e311e14236a979ce061538ec8b8bad8655f.tar.gz
sapenc: Pass the title on to the chained muxers
This makes sure it ends up in the SDP, providing a proper session name in the SAP announcements. Signed-off-by: Martin Storsjö <martin@martin.st>
-rw-r--r--libavformat/sapenc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/sapenc.c b/libavformat/sapenc.c
index fd9be4f5a7..7e2bba7a28 100644
--- a/libavformat/sapenc.c
+++ b/libavformat/sapenc.c
@@ -23,6 +23,7 @@
#include "libavutil/parseutils.h"
#include "libavutil/random_seed.h"
#include "libavutil/avstring.h"
+#include "libavutil/dict.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/time.h"
#include "internal.h"
@@ -76,6 +77,7 @@ static int sap_write_header(AVFormatContext *s)
struct sockaddr_storage localaddr;
socklen_t addrlen = sizeof(localaddr);
int udp_fd;
+ AVDictionaryEntry* title = av_dict_get(s->metadata, "title", NULL, 0);
if (!ff_network_init())
return AVERROR(EIO);
@@ -158,6 +160,9 @@ static int sap_write_header(AVFormatContext *s)
av_strlcpy(contexts[i]->filename, url, sizeof(contexts[i]->filename));
}
+ if (s->nb_streams > 0 && title)
+ av_dict_set(&contexts[0]->metadata, "title", title->value, 0);
+
ff_url_join(url, sizeof(url), "udp", NULL, announce_addr, port,
"?ttl=%d&connect=1", ttl);
ret = ffurl_open(&sap->ann_fd, url, AVIO_FLAG_WRITE,