[FFmpeg-cvslog] SAP muxer set session name from metadata
Jernej Virag
git at videolan.org
Mon Dec 17 17:32:21 CET 2012
ffmpeg | branch: master | Jernej Virag <jernej at virag.si> | Mon Dec 17 10:04:15 2012 +0100| [2f7465b5bf6ca6aff5a3f0dd671695e86972538c] | committer: Michael Niedermayer
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 at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2f7465b5bf6ca6aff5a3f0dd671695e86972538c
---
libavformat/sapenc.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/libavformat/sapenc.c b/libavformat/sapenc.c
index 7abfd50..87e6082 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,
More information about the ffmpeg-cvslog
mailing list