summaryrefslogtreecommitdiff
path: root/libavformat/sapenc.c
diff options
context:
space:
mode:
authorJernej Virag <jernej@virag.si>2012-12-17 10:04:15 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-12-17 17:31:55 +0100
commit2f7465b5bf6ca6aff5a3f0dd671695e86972538c (patch)
treebffbd9e11af1224a27141777f748bd0cdb3d4b47 /libavformat/sapenc.c
parent8976ef7aec4c62e41a0abb50d2bf4dbfa3508e2a (diff)
downloadffmpeg-2f7465b5bf6ca6aff5a3f0dd671695e86972538c.tar.gz
SAP muxer set session name from metadata
Pass "title" metadata field to av_sdp_create (as in RTP muxer) in SAP muxer for correct session name in SAP SDP announcements. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/sapenc.c')
-rw-r--r--libavformat/sapenc.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavformat/sapenc.c b/libavformat/sapenc.c
index 7abfd50d35..87e608298f 100644
--- a/libavformat/sapenc.c
+++ b/libavformat/sapenc.c
@@ -25,6 +25,7 @@
#include "libavutil/avstring.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/time.h"
+#include "libavutil/dict.h"
#include "internal.h"
#include "network.h"
#include "os_support.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,10 @@ 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,