[FFmpeg-devel] [PATCH] gas-preprocessor: Fix use of Visual Studio compiler values -w... or -FS

2020-04-20 Thread phunkyfish
From: Alwin Esch 

---
 gas-preprocessor.pl | 4 
 1 file changed, 4 insertions(+)

diff --git a/gas-preprocessor.pl b/gas-preprocessor.pl
index 860b97c..126ee50 100755
--- a/gas-preprocessor.pl
+++ b/gas-preprocessor.pl
@@ -164,6 +164,8 @@ if ($as_type ne "armasm") {
 @preprocess_c_cmd = grep ! /^-EHsc$/, @preprocess_c_cmd;
 @preprocess_c_cmd = grep ! /^-O/, @preprocess_c_cmd;
 @preprocess_c_cmd = grep ! /^-oldit/, @preprocess_c_cmd;
+@preprocess_c_cmd = grep ! /^-FS/, @preprocess_c_cmd;
+@preprocess_c_cmd = grep ! /^-w/, @preprocess_c_cmd;
 
 @gcc_cmd = grep ! /^-G/, @gcc_cmd;
 @gcc_cmd = grep ! /^-W/, @gcc_cmd;
@@ -171,6 +173,8 @@ if ($as_type ne "armasm") {
 @gcc_cmd = grep ! /^-fp/, @gcc_cmd;
 @gcc_cmd = grep ! /^-EHsc$/, @gcc_cmd;
 @gcc_cmd = grep ! /^-O/, @gcc_cmd;
+@gcc_cmd = grep ! /^-FS/, @gcc_cmd;
+@gcc_cmd = grep ! /^-w/, @gcc_cmd;
 
 my @outfiles = grep /\.(o|obj)$/, @gcc_cmd;
 $tempfile = $outfiles[0].".asm";
-- 
2.24.2 (Apple Git-127)

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH] avformat/rtp: Pass sources and block filter addresses via sdp file for rtp

2020-04-07 Thread phunkyfish
---
 libavformat/rtsp.c | 48 +-
 1 file changed, 39 insertions(+), 9 deletions(-)

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index cd6fc32a29..07ac371903 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -21,6 +21,7 @@
 
 #include "libavutil/avassert.h"
 #include "libavutil/base64.h"
+#include "libavutil/bprint.h"
 #include "libavutil/avstring.h"
 #include "libavutil/intreadwrite.h"
 #include "libavutil/mathematics.h"
@@ -2447,7 +2448,7 @@ static int rtp_probe(const AVProbeData *p)
 static int rtp_read_header(AVFormatContext *s)
 {
 uint8_t recvbuf[RTP_MAX_PACKET_LENGTH];
-char host[500], sdp[500];
+char host[500], filters_buf[1000];
 int ret, port;
 URLContext* in = NULL;
 int payload_type;
@@ -2456,6 +2457,8 @@ static int rtp_read_header(AVFormatContext *s)
 AVIOContext pb;
 socklen_t addrlen = sizeof(addr);
 RTSPState *rt = s->priv_data;
+const char *p;
+AVBPrint sdp;
 
 if (!ff_network_init())
 return AVERROR(EIO);
@@ -2513,16 +2516,38 @@ static int rtp_read_header(AVFormatContext *s)
 av_url_split(NULL, 0, NULL, 0, host, sizeof(host), &port,
  NULL, 0, s->url);
 
-snprintf(sdp, sizeof(sdp),
- "v=0\r\nc=IN IP%d %s\r\nm=%s %d RTP/AVP %d\r\n",
- addr.ss_family == AF_INET ? 4 : 6, host,
- par->codec_type == AVMEDIA_TYPE_DATA  ? "application" :
- par->codec_type == AVMEDIA_TYPE_VIDEO ? "video" : "audio",
- port, payload_type);
-av_log(s, AV_LOG_VERBOSE, "SDP:\n%s\n", sdp);
+av_bprint_init(&sdp, 0, AV_BPRINT_SIZE_UNLIMITED);
+av_bprintf(&sdp, "v=0\r\nc=IN IP%d %s\r\n",
+   addr.ss_family == AF_INET ? 4 : 6, host);
+
+p = strchr(s->url, '?');
+if (p) {
+static const char *filters[][2] = {{"sources", "incl"}, {"block", 
"excl"}, {NULL, NULL}};
+int i;
+char *q;
+for (i = 0; filters[i][0]; i++) {
+if (av_find_info_tag(filters_buf, sizeof(filters_buf), 
filters[i][0], p)) {
+q = filters_buf;
+while ((q = strchr(q, ',')) != NULL)
+*q = ' ';
+av_bprintf(&sdp, "a=source-filter:%s IN IP%d %s %s\r\n",
+   filters[i][1],
+   addr.ss_family == AF_INET ? 4 : 6, host,
+   filters_buf);
+}
+}
+}
+
+av_bprintf(&sdp, "m=%s %d RTP/AVP %d\r\n",
+   par->codec_type == AVMEDIA_TYPE_DATA  ? "application" :
+   par->codec_type == AVMEDIA_TYPE_VIDEO ? "video" : "audio",
+   port, payload_type);
+av_log(s, AV_LOG_VERBOSE, "SDP:\n%s\n", sdp.str);
+if (!av_bprint_is_complete(&sdp))
+goto fail_nobuf;
 avcodec_parameters_free(&par);
 
-ffio_init_context(&pb, sdp, strlen(sdp), 0, NULL, NULL, NULL, NULL);
+ffio_init_context(&pb, sdp.str, sdp.len, 0, NULL, NULL, NULL, NULL);
 s->pb = &pb;
 
 /* sdp_read_header initializes this again */
@@ -2532,9 +2557,14 @@ static int rtp_read_header(AVFormatContext *s)
 
 ret = sdp_read_header(s);
 s->pb = NULL;
+av_bprint_finalize(&sdp, NULL);
 return ret;
 
+fail_nobuf:
+ret = AVERROR(ENOMEM);
+av_log(s, AV_LOG_ERROR, "rtp_read_header(): not enough buffer space for 
sdp-headers\n");
 fail:
+av_bprint_finalize(&sdp, NULL);
 avcodec_parameters_free(&par);
 if (in)
 ffurl_close(in);
-- 
2.24.1 (Apple Git-126)

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH] avformat/rtp: Pass sources and block filter addresses via sdp file for rtp

2020-04-07 Thread phunkyfish
---
 libavformat/rtsp.c | 48 +-
 1 file changed, 39 insertions(+), 9 deletions(-)

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index cd6fc32a29..dad3f7915e 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -21,6 +21,7 @@
 
 #include "libavutil/avassert.h"
 #include "libavutil/base64.h"
+#include "libavutil/bprint.h"
 #include "libavutil/avstring.h"
 #include "libavutil/intreadwrite.h"
 #include "libavutil/mathematics.h"
@@ -2447,7 +2448,7 @@ static int rtp_probe(const AVProbeData *p)
 static int rtp_read_header(AVFormatContext *s)
 {
 uint8_t recvbuf[RTP_MAX_PACKET_LENGTH];
-char host[500], sdp[500];
+char host[500], filters_buf[1000];
 int ret, port;
 URLContext* in = NULL;
 int payload_type;
@@ -2456,6 +2457,8 @@ static int rtp_read_header(AVFormatContext *s)
 AVIOContext pb;
 socklen_t addrlen = sizeof(addr);
 RTSPState *rt = s->priv_data;
+const char *p;
+AVBPrint sdp;
 
 if (!ff_network_init())
 return AVERROR(EIO);
@@ -2513,16 +2516,38 @@ static int rtp_read_header(AVFormatContext *s)
 av_url_split(NULL, 0, NULL, 0, host, sizeof(host), &port,
  NULL, 0, s->url);
 
-snprintf(sdp, sizeof(sdp),
- "v=0\r\nc=IN IP%d %s\r\nm=%s %d RTP/AVP %d\r\n",
- addr.ss_family == AF_INET ? 4 : 6, host,
- par->codec_type == AVMEDIA_TYPE_DATA  ? "application" :
- par->codec_type == AVMEDIA_TYPE_VIDEO ? "video" : "audio",
- port, payload_type);
-av_log(s, AV_LOG_VERBOSE, "SDP:\n%s\n", sdp);
+av_bprint_init(&sdp, 0, AV_BPRINT_SIZE_UNLIMITED);
+av_bprintf(&sdp, "v=0\r\nc=IN IP%d %s\r\n",
+   addr.ss_family == AF_INET ? 4 : 6, host);
+
+p = strchr(s->url, '?');
+if (p) {
+static const char *filters[][2] = {{"sources", "incl"}, {"block", 
"excl"}, {NULL, NULL}};
+int i;
+char *q;
+for (i = 0; filters[i][0]; i++) {
+if (av_find_info_tag(filters_buf, sizeof(filters_buf), 
filters[i][0], p)) {
+q = filters_buf;
+while ((q = strchr(q, ',')) != NULL)
+*q = ' ';
+av_bprintf(&sdp, "a=source-filter:%s IN IP%d %s %s\r\n",
+   filters[i][1],
+   addr.ss_family == AF_INET ? 4 : 6, host,
+   filters_buf);
+}
+}
+}
+
+av_bprintf(&sdp, "m=%s %d RTP/AVP %d\r\n",
+   par->codec_type == AVMEDIA_TYPE_DATA  ? "application" :
+   par->codec_type == AVMEDIA_TYPE_VIDEO ? "video" : "audio",
+   port, payload_type);
+av_log(s, AV_LOG_VERBOSE, "SDP:\n%s\n", sdp.str);
+if (av_bprint_is_complete(&sdp))
+goto fail_nobuf;
 avcodec_parameters_free(&par);
 
-ffio_init_context(&pb, sdp, strlen(sdp), 0, NULL, NULL, NULL, NULL);
+ffio_init_context(&pb, sdp.str, strlen(sdp.str), 0, NULL, NULL, NULL, 
NULL);
 s->pb = &pb;
 
 /* sdp_read_header initializes this again */
@@ -2532,9 +2557,14 @@ static int rtp_read_header(AVFormatContext *s)
 
 ret = sdp_read_header(s);
 s->pb = NULL;
+av_bprint_finalize(&sdp, NULL);
 return ret;
 
+fail_nobuf:
+ret = AVERROR(ENOMEM);
+av_log(s, AV_LOG_ERROR, "rtp_read_header(): not enough buffer space for 
sdp-headers\n");
 fail:
+av_bprint_finalize(&sdp, NULL);
 avcodec_parameters_free(&par);
 if (in)
 ffurl_close(in);
-- 
2.24.1 (Apple Git-126)

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH] avformat/rtp: Pass sources and block filter addresses via sdp file for rtp

2020-04-06 Thread phunkyfish
---
 libavformat/rtsp.c | 50 +-
 1 file changed, 41 insertions(+), 9 deletions(-)

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index cd6fc32a29..2b59a9330d 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -21,6 +21,7 @@
 
 #include "libavutil/avassert.h"
 #include "libavutil/base64.h"
+#include "libavutil/bprint.h"
 #include "libavutil/avstring.h"
 #include "libavutil/intreadwrite.h"
 #include "libavutil/mathematics.h"
@@ -2447,7 +2448,7 @@ static int rtp_probe(const AVProbeData *p)
 static int rtp_read_header(AVFormatContext *s)
 {
 uint8_t recvbuf[RTP_MAX_PACKET_LENGTH];
-char host[500], sdp[500];
+char host[500], filters_buf[1000];
 int ret, port;
 URLContext* in = NULL;
 int payload_type;
@@ -2456,6 +2457,8 @@ static int rtp_read_header(AVFormatContext *s)
 AVIOContext pb;
 socklen_t addrlen = sizeof(addr);
 RTSPState *rt = s->priv_data;
+const char *p;
+AVBPrint sdp;
 
 if (!ff_network_init())
 return AVERROR(EIO);
@@ -2513,16 +2516,40 @@ static int rtp_read_header(AVFormatContext *s)
 av_url_split(NULL, 0, NULL, 0, host, sizeof(host), &port,
  NULL, 0, s->url);
 
-snprintf(sdp, sizeof(sdp),
- "v=0\r\nc=IN IP%d %s\r\nm=%s %d RTP/AVP %d\r\n",
- addr.ss_family == AF_INET ? 4 : 6, host,
- par->codec_type == AVMEDIA_TYPE_DATA  ? "application" :
- par->codec_type == AVMEDIA_TYPE_VIDEO ? "video" : "audio",
- port, payload_type);
-av_log(s, AV_LOG_VERBOSE, "SDP:\n%s\n", sdp);
+av_bprint_init(&sdp, 0, AV_BPRINT_SIZE_UNLIMITED);
+av_bprintf(&sdp, "v=0\r\nc=IN IP%d %s\r\n",
+   addr.ss_family == AF_INET ? 4 : 6, host);
+
+p = strchr(s->url, '?');
+if (p) {
+static const char *filters[][2] = {{"sources", "incl"}, {"block", 
"excl"}, {NULL, NULL}};
+int i;
+char *q;
+for (i = 0; filters[i][0]; i++) {
+if (av_find_info_tag(filters_buf, sizeof(filters_buf), 
filters[i][0], p)) {
+q = filters_buf;
+while ((q = strchr(q, ',')) != NULL)
+*q = ' ';
+av_bprintf(&sdp, "a=source-filter:%s IN IP%d %s %s\r\n",
+   filters[i][1],
+   addr.ss_family == AF_INET ? 4 : 6, host,
+   filters_buf);
+if (sdp.len != sdp.size)
+goto fail_nobuf;
+}
+}
+}
+
+av_bprintf(&sdp, "m=%s %d RTP/AVP %d\r\n",
+   par->codec_type == AVMEDIA_TYPE_DATA  ? "application" :
+   par->codec_type == AVMEDIA_TYPE_VIDEO ? "video" : "audio",
+   port, payload_type);
+av_log(s, AV_LOG_VERBOSE, "SDP:\n%s\n", sdp.str);
+if (sdp.len != sdp.size)
+goto fail_nobuf;
 avcodec_parameters_free(&par);
 
-ffio_init_context(&pb, sdp, strlen(sdp), 0, NULL, NULL, NULL, NULL);
+ffio_init_context(&pb, sdp.str, strlen(sdp.str), 0, NULL, NULL, NULL, 
NULL);
 s->pb = &pb;
 
 /* sdp_read_header initializes this again */
@@ -2532,9 +2559,14 @@ static int rtp_read_header(AVFormatContext *s)
 
 ret = sdp_read_header(s);
 s->pb = NULL;
+av_bprint_finalize(&sdp, NULL);
 return ret;
 
+fail_nobuf:
+ret = AVERROR(ENOBUFS);
+av_log(s, AV_LOG_ERROR, "rtp_read_header(): not enough buffer space for 
sdp-headers\n");
 fail:
+av_bprint_finalize(&sdp, NULL);
 avcodec_parameters_free(&par);
 if (in)
 ffurl_close(in);
-- 
2.24.1 (Apple Git-126)

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH] avformat/rtp: Pass sources and block filter addresses via sdp file for rtp

2020-04-06 Thread phunkyfish
---
 libavformat/rtsp.c | 47 ++
 1 file changed, 39 insertions(+), 8 deletions(-)

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index cd6fc32a29..0d0bc2be0d 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -2447,8 +2447,8 @@ static int rtp_probe(const AVProbeData *p)
 static int rtp_read_header(AVFormatContext *s)
 {
 uint8_t recvbuf[RTP_MAX_PACKET_LENGTH];
-char host[500], sdp[500];
-int ret, port;
+char host[500], sdp[1000], filters_buf[1000];
+int ret, port, sdp_length, nc;
 URLContext* in = NULL;
 int payload_type;
 AVCodecParameters *par = NULL;
@@ -2456,6 +2456,7 @@ static int rtp_read_header(AVFormatContext *s)
 AVIOContext pb;
 socklen_t addrlen = sizeof(addr);
 RTSPState *rt = s->priv_data;
+const char *p;
 
 if (!ff_network_init())
 return AVERROR(EIO);
@@ -2513,13 +2514,40 @@ static int rtp_read_header(AVFormatContext *s)
 av_url_split(NULL, 0, NULL, 0, host, sizeof(host), &port,
  NULL, 0, s->url);
 
-snprintf(sdp, sizeof(sdp),
- "v=0\r\nc=IN IP%d %s\r\nm=%s %d RTP/AVP %d\r\n",
- addr.ss_family == AF_INET ? 4 : 6, host,
- par->codec_type == AVMEDIA_TYPE_DATA  ? "application" :
- par->codec_type == AVMEDIA_TYPE_VIDEO ? "video" : "audio",
- port, payload_type);
+sdp_length = snprintf(sdp, sizeof(sdp),
+  "v=0\r\nc=IN IP%d %s\r\n",
+  addr.ss_family == AF_INET ? 4 : 6, host);
+
+p = strchr(s->url, '?');
+if (p) {
+static const char *filters[][2] = {{"sources", "incl"}, {"block", 
"excl"}, {NULL, NULL}};
+int i;
+char *q;
+for (i = 0; filters[i][0]; i++) {
+if (av_find_info_tag(filters_buf, sizeof(filters_buf), 
filters[i][0], p)) {
+q = filters_buf;
+while ((q = strchr(q, ',')) != NULL)
+*q = ' ';
+nc = snprintf(sdp + sdp_length, sizeof(sdp) - sdp_length,
+  "a=source-filter:%s IN IP%d %s %s\r\n",
+  filters[i][1],
+  addr.ss_family == AF_INET ? 4 : 6, host,
+  filters_buf);
+if (nc < 0 || nc + sdp_length >= sizeof(sdp))
+goto fail_nobuf;
+sdp_length += nc;
+}
+}
+}
+
+nc = snprintf(sdp + sdp_length, sizeof(sdp) - sdp_length,
+  "m=%s %d RTP/AVP %d\r\n",
+  par->codec_type == AVMEDIA_TYPE_DATA  ? "application" :
+  par->codec_type == AVMEDIA_TYPE_VIDEO ? "video" : "audio",
+  port, payload_type);
 av_log(s, AV_LOG_VERBOSE, "SDP:\n%s\n", sdp);
+if (nc < 0 || nc + sdp_length >= sizeof(sdp))
+goto fail_nobuf;
 avcodec_parameters_free(&par);
 
 ffio_init_context(&pb, sdp, strlen(sdp), 0, NULL, NULL, NULL, NULL);
@@ -2534,6 +2562,9 @@ static int rtp_read_header(AVFormatContext *s)
 s->pb = NULL;
 return ret;
 
+fail_nobuf:
+ret = AVERROR(ENOBUFS);
+av_log(s, AV_LOG_ERROR, "rtp_read_header(): not enough buffer space for 
sdp-headers\n");
 fail:
 avcodec_parameters_free(&par);
 if (in)
-- 
2.24.1 (Apple Git-126)

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH] avformat/rtp: Pass sources and block filter addresses via sdp file for rtp

2020-03-27 Thread phunkyfish
---
 libavformat/rtsp.c | 46 ++
 1 file changed, 38 insertions(+), 8 deletions(-)

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index cd6fc32a29..1aec070382 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -2447,8 +2447,8 @@ static int rtp_probe(const AVProbeData *p)
 static int rtp_read_header(AVFormatContext *s)
 {
 uint8_t recvbuf[RTP_MAX_PACKET_LENGTH];
-char host[500], sdp[500];
-int ret, port;
+char host[500], sdp[1000], filters_buf[1000];
+int ret, port, sdp_length, nc;
 URLContext* in = NULL;
 int payload_type;
 AVCodecParameters *par = NULL;
@@ -2456,6 +2456,7 @@ static int rtp_read_header(AVFormatContext *s)
 AVIOContext pb;
 socklen_t addrlen = sizeof(addr);
 RTSPState *rt = s->priv_data;
+const char *p
 
 if (!ff_network_init())
 return AVERROR(EIO);
@@ -2513,12 +2514,39 @@ static int rtp_read_header(AVFormatContext *s)
 av_url_split(NULL, 0, NULL, 0, host, sizeof(host), &port,
  NULL, 0, s->url);
 
-snprintf(sdp, sizeof(sdp),
- "v=0\r\nc=IN IP%d %s\r\nm=%s %d RTP/AVP %d\r\n",
- addr.ss_family == AF_INET ? 4 : 6, host,
- par->codec_type == AVMEDIA_TYPE_DATA  ? "application" :
- par->codec_type == AVMEDIA_TYPE_VIDEO ? "video" : "audio",
- port, payload_type);
+sdp_length = snprintf(sdp, sizeof(sdp),
+  "v=0\r\nc=IN IP%d %s\r\n",
+  addr.ss_family == AF_INET ? 4 : 6, host);
+
+p = strchr(s->url, '?');
+if (p) {
+static const char *filters[][2] = {{"sources", "incl"}, {"block", 
"excl"}, {NULL, NULL}};
+int i;
+char *q;
+for (i = 0; filters[i][0]; i++) {
+if (av_find_info_tag(filters_buf, sizeof(filters_buf), 
filters[i][0], p)) {
+q = filters_buf;
+while ((q = strchr(q, ',')) != NULL)
+*q = ' ';
+nc = snprintf(sdp + sdp_length, sizeof(sdp) - sdp_length,
+  "a=source-filter:%s IN IP%d %s %s\r\n",
+  filters[i][1],
+  addr.ss_family == AF_INET ? 4 : 6, host,
+  filters_buf);
+if (nc < 0 || nc + sdp_length >= sizeof(sdp))
+goto fail_nobuf;
+sdp_length += nc;
+}
+}
+}
+
+nc = snprintf(sdp + sdp_length, sizeof(sdp) - sdp_length,
+  "m=%s %d RTP/AVP %d\r\n",
+  par->codec_type == AVMEDIA_TYPE_DATA  ? "application" :
+  par->codec_type == AVMEDIA_TYPE_VIDEO ? "video" : "audio",
+  port, payload_type);
+if (nc < 0 || nc + sdp_length >= sizeof(sdp))
+goto fail_nobuf;
 av_log(s, AV_LOG_VERBOSE, "SDP:\n%s\n", sdp);
 avcodec_parameters_free(&par);
 
@@ -2534,6 +2562,8 @@ static int rtp_read_header(AVFormatContext *s)
 s->pb = NULL;
 return ret;
 
+fail_nobuf:
+ret = AVERROR(ENOBUFS);
 fail:
 avcodec_parameters_free(&par);
 if (in)
-- 
2.21.1 (Apple Git-122.3)

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH] avformat/rtp: Pass sources and block filter addresses via sdp file for rtp

2020-03-04 Thread phunkyfish
---
 libavformat/rtsp.c | 48 ++
 1 file changed, 40 insertions(+), 8 deletions(-)

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index cd6fc32a29..f6d66526b0 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -2447,8 +2447,8 @@ static int rtp_probe(const AVProbeData *p)
 static int rtp_read_header(AVFormatContext *s)
 {
 uint8_t recvbuf[RTP_MAX_PACKET_LENGTH];
-char host[500], sdp[500];
-int ret, port;
+char host[500], sdp[1000], filters_buf[1000];
+int ret, port, sdp_length, nc;
 URLContext* in = NULL;
 int payload_type;
 AVCodecParameters *par = NULL;
@@ -2456,6 +2456,7 @@ static int rtp_read_header(AVFormatContext *s)
 AVIOContext pb;
 socklen_t addrlen = sizeof(addr);
 RTSPState *rt = s->priv_data;
+const char *p;
 
 if (!ff_network_init())
 return AVERROR(EIO);
@@ -2513,12 +2514,40 @@ static int rtp_read_header(AVFormatContext *s)
 av_url_split(NULL, 0, NULL, 0, host, sizeof(host), &port,
  NULL, 0, s->url);
 
-snprintf(sdp, sizeof(sdp),
- "v=0\r\nc=IN IP%d %s\r\nm=%s %d RTP/AVP %d\r\n",
- addr.ss_family == AF_INET ? 4 : 6, host,
- par->codec_type == AVMEDIA_TYPE_DATA  ? "application" :
- par->codec_type == AVMEDIA_TYPE_VIDEO ? "video" : "audio",
- port, payload_type);
+sdp_length = snprintf(sdp, sizeof(sdp),
+  "v=0\r\nc=IN IP%d %s\r\n",
+  addr.ss_family == AF_INET ? 4 : 6, host);
+
+p = strchr(s->url, '?');
+if (p) {
+static const char *filters[][2] = {{"sources", "incl"}, {"block", 
"excl"}, {NULL, NULL}};
+int i;
+char *q;
+for (i = 0; filters[i][0]; i++) {
+if (av_find_info_tag(filters_buf, sizeof(filters_buf), 
filters[i][0], p)) {
+/* av_log(s, AV_LOG_VERBOSE, "rtp_read_header() found %s 
%s\n", filters[i][0], filters_buf); */
+q = filters_buf;
+while ((q = strchr(q, ',')) != NULL)
+*q = ' ';
+nc = snprintf(sdp + sdp_length, sizeof(sdp) - sdp_length,
+  "a=source-filter:%s IN IP%d %s %s\r\n",
+  filters[i][1],
+  addr.ss_family == AF_INET ? 4 : 6, host,
+  filters_buf);
+if (nc < 0 || nc + sdp_length >= sizeof(sdp))
+goto fail_nobuf;
+sdp_length += nc;
+}
+}
+}
+
+nc = snprintf(sdp + sdp_length, sizeof(sdp) - sdp_length,
+  "m=%s %d RTP/AVP %d\r\n",
+  par->codec_type == AVMEDIA_TYPE_DATA  ? "application" :
+  par->codec_type == AVMEDIA_TYPE_VIDEO ? "video" : "audio",
+  port, payload_type);
+if (nc < 0 || nc + sdp_length >= sizeof(sdp))
+goto fail_nobuf;
 av_log(s, AV_LOG_VERBOSE, "SDP:\n%s\n", sdp);
 avcodec_parameters_free(&par);
 
@@ -2534,6 +2563,9 @@ static int rtp_read_header(AVFormatContext *s)
 s->pb = NULL;
 return ret;
 
+fail_nobuf:
+ret = AVERROR(ENOBUFS);
+av_log(s, AV_LOG_ERROR, "rtp_read_header(): not enough buffer space for 
sdp-headers\n");
 fail:
 avcodec_parameters_free(&par);
 if (in)
-- 
2.20.1 (Apple Git-117)

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH] avformat/udp: support w32pthreads compat

2020-03-02 Thread phunkyfish
---
 compat/w32pthreads.h | 8 
 libavformat/udp.c| 7 ++-
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/compat/w32pthreads.h b/compat/w32pthreads.h
index 7df33b7da4..6405e72b64 100644
--- a/compat/w32pthreads.h
+++ b/compat/w32pthreads.h
@@ -63,6 +63,9 @@ typedef CONDITION_VARIABLE pthread_cond_t;
 #define InitializeCriticalSection(x) InitializeCriticalSectionEx(x, 0, 0)
 #define WaitForSingleObject(a, b) WaitForSingleObjectEx(a, b, FALSE)
 
+#define PTHREAD_CANCEL_ENABLE 1
+#define PTHREAD_CANCEL_DISABLE 0
+
 static av_unused unsigned __stdcall attribute_align_arg 
win32thread_worker(void *arg)
 {
 pthread_t *h = (pthread_t*)arg;
@@ -180,4 +183,9 @@ static inline int pthread_cond_signal(pthread_cond_t *cond)
 return 0;
 }
 
+static inline int pthread_setcancelstate(int state, int *oldstate)
+{
+return 0;
+}
+
 #endif /* COMPAT_W32PTHREADS_H */
diff --git a/libavformat/udp.c b/libavformat/udp.c
index 23c3773c64..3af6b09ca7 100644
--- a/libavformat/udp.c
+++ b/libavformat/udp.c
@@ -61,8 +61,13 @@
 #define IPPROTO_UDPLITE  136
 #endif
 
+#if HAVE_W32THREADS 
+#undef HAVE_PTHREAD_CANCEL 
+#define HAVE_PTHREAD_CANCEL 1
+#endif
+
 #if HAVE_PTHREAD_CANCEL
-#include 
+#include "libavutil/thread.h"
 #endif
 
 #ifndef IPV6_ADD_MEMBERSHIP
-- 
2.20.1 (Apple Git-117)

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH] avformat/rtp: Pass sources and block filter addresses via sdp file for rtp

2020-03-02 Thread phunkyfish
---
 libavformat/rtsp.c | 49 ++
 1 file changed, 41 insertions(+), 8 deletions(-)

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index cd6fc32a29..d23ec5723e 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -2447,8 +2447,8 @@ static int rtp_probe(const AVProbeData *p)
 static int rtp_read_header(AVFormatContext *s)
 {
 uint8_t recvbuf[RTP_MAX_PACKET_LENGTH];
-char host[500], sdp[500];
-int ret, port;
+char host[500], sdp[1000], filters_buf[1000];
+int ret, port, sdp_length, nc;
 URLContext* in = NULL;
 int payload_type;
 AVCodecParameters *par = NULL;
@@ -2456,6 +2456,7 @@ static int rtp_read_header(AVFormatContext *s)
 AVIOContext pb;
 socklen_t addrlen = sizeof(addr);
 RTSPState *rt = s->priv_data;
+const char *p;
 
 if (!ff_network_init())
 return AVERROR(EIO);
@@ -2513,12 +2514,41 @@ static int rtp_read_header(AVFormatContext *s)
 av_url_split(NULL, 0, NULL, 0, host, sizeof(host), &port,
  NULL, 0, s->url);
 
-snprintf(sdp, sizeof(sdp),
- "v=0\r\nc=IN IP%d %s\r\nm=%s %d RTP/AVP %d\r\n",
- addr.ss_family == AF_INET ? 4 : 6, host,
- par->codec_type == AVMEDIA_TYPE_DATA  ? "application" :
- par->codec_type == AVMEDIA_TYPE_VIDEO ? "video" : "audio",
- port, payload_type);
+sdp_length = snprintf(sdp + sdp_length, sizeof(sdp) - sdp_length,
+  "v=0\r\nc=IN IP%d %s\r\n",
+  addr.ss_family == AF_INET ? 4 : 6, host);
+
+p = strchr(s->url, '?');
+if (p) {
+static const char *filters[][2] = {{"sources", "incl"}, {"block", 
"excl"}, {NULL, NULL}};
+int i;
+char *q;
+for (i = 0; filters[i][0]; i++) {
+if (av_find_info_tag(filters_buf, sizeof(filters_buf), 
filters[i][0], p)) {
+/* av_log(s, AV_LOG_VERBOSE, "rtp_read_header() found %s 
%s\n", filters[i][0], filters_buf); */
+q = filters_buf;
+while ((q = strchr(q, ',')) != NULL)
+*q = ' ';
+nc = snprintf(sdp + sdp_length, sizeof(sdp) - sdp_length,
+  "a=source-filter:%s IN IP%d %s %s\r\n",
+  filters[i][1],
+  addr.ss_family == AF_INET ? 4 : 6, host,
+  filters_buf);
+if (nc < 0 || nc + sdp_length >= sizeof(sdp))
+goto fail_nobuf;
+sdp_length += nc;
+}
+}
+}
+
+nc = snprintf(sdp + sdp_length, sizeof(sdp) - sdp_length,
+  "m=%s %d RTP/AVP %d\r\n",
+  par->codec_type == AVMEDIA_TYPE_DATA  ? "application" :
+  par->codec_type == AVMEDIA_TYPE_VIDEO ? "video" : "audio",
+  port, payload_type);
+if (nc < 0 || nc + sdp_length >= sizeof(sdp))
+goto fail_nobuf;
+sdp_length += nc;
 av_log(s, AV_LOG_VERBOSE, "SDP:\n%s\n", sdp);
 avcodec_parameters_free(&par);
 
@@ -2534,6 +2564,9 @@ static int rtp_read_header(AVFormatContext *s)
 s->pb = NULL;
 return ret;
 
+fail_nobuf:
+ret = AVERROR(ENOBUFS);
+av_log(s, AV_LOG_ERROR, "rtp_read_header(): not enough buffer space for 
sdp-headers\n");
 fail:
 avcodec_parameters_free(&par);
 if (in)
-- 
2.20.1 (Apple Git-117)

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH] avformat/rtp: Pass sources and block filter addresses via sdp file for rtp

2020-03-02 Thread phunkyfish
---
 libavformat/rtsp.c | 49 ++
 1 file changed, 41 insertions(+), 8 deletions(-)

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index cd6fc32a29..c744e403c6 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -2447,8 +2447,8 @@ static int rtp_probe(const AVProbeData *p)
 static int rtp_read_header(AVFormatContext *s)
 {
 uint8_t recvbuf[RTP_MAX_PACKET_LENGTH];
-char host[500], sdp[500];
-int ret, port;
+char host[500], sdp[1000], filters_buf[1000];
+int ret, port, sdp_length, nc;
 URLContext* in = NULL;
 int payload_type;
 AVCodecParameters *par = NULL;
@@ -2456,6 +2456,7 @@ static int rtp_read_header(AVFormatContext *s)
 AVIOContext pb;
 socklen_t addrlen = sizeof(addr);
 RTSPState *rt = s->priv_data;
+const char *p
 
 if (!ff_network_init())
 return AVERROR(EIO);
@@ -2513,12 +2514,41 @@ static int rtp_read_header(AVFormatContext *s)
 av_url_split(NULL, 0, NULL, 0, host, sizeof(host), &port,
  NULL, 0, s->url);
 
-snprintf(sdp, sizeof(sdp),
- "v=0\r\nc=IN IP%d %s\r\nm=%s %d RTP/AVP %d\r\n",
- addr.ss_family == AF_INET ? 4 : 6, host,
- par->codec_type == AVMEDIA_TYPE_DATA  ? "application" :
- par->codec_type == AVMEDIA_TYPE_VIDEO ? "video" : "audio",
- port, payload_type);
+sdp_length = snprintf(sdp + sdp_length, sizeof(sdp) - sdp_length,
+  "v=0\r\nc=IN IP%d %s\r\n",
+  addr.ss_family == AF_INET ? 4 : 6, host);
+
+p = strchr(s->url, '?');
+if (p) {
+static const char *filters[][2] = {{"sources", "incl"}, {"block", 
"excl"}, {NULL, NULL}};
+int i;
+char *q;
+for (i = 0; filters[i][0]; i++) {
+if (av_find_info_tag(filters_buf, sizeof(filters_buf), 
filters[i][0], p)) {
+/* av_log(s, AV_LOG_VERBOSE, "rtp_read_header() found %s 
%s\n", filters[i][0], filters_buf); */
+q = filters_buf;
+while ((q = strchr(q, ',')) != NULL)
+*q = ' ';
+nc = snprintf(sdp + sdp_length, sizeof(sdp) - sdp_length,
+  "a=source-filter:%s IN IP%d %s %s\r\n",
+  filters[i][1],
+  addr.ss_family == AF_INET ? 4 : 6, host,
+  filters_buf);
+if (nc < 0 || nc + sdp_length >= sizeof(sdp))
+goto fail_nobuf;
+sdp_length += nc;
+}
+}
+}
+
+nc = snprintf(sdp + sdp_length, sizeof(sdp) - sdp_length,
+  "m=%s %d RTP/AVP %d\r\n",
+  par->codec_type == AVMEDIA_TYPE_DATA  ? "application" :
+  par->codec_type == AVMEDIA_TYPE_VIDEO ? "video" : "audio",
+  port, payload_type);
+if (nc < 0 || nc + sdp_length >= sizeof(sdp))
+goto fail_nobuf;
+sdp_length += nc;
 av_log(s, AV_LOG_VERBOSE, "SDP:\n%s\n", sdp);
 avcodec_parameters_free(&par);
 
@@ -2534,6 +2564,9 @@ static int rtp_read_header(AVFormatContext *s)
 s->pb = NULL;
 return ret;
 
+fail_nobuf:
+ret = AVERROR(ENOBUFS);
+av_log(s, AV_LOG_ERROR, "rtp_read_header(): not enough buffer space for 
sdp-headers\n");
 fail:
 avcodec_parameters_free(&par);
 if (in)
-- 
2.20.1 (Apple Git-117)

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH] avformat/udp: support w32pthreads compat

2020-03-02 Thread phunkyfish
---
 compat/w32pthreads.h | 8 
 libavformat/udp.c| 6 +-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/compat/w32pthreads.h b/compat/w32pthreads.h
index 7df33b7da4..6405e72b64 100644
--- a/compat/w32pthreads.h
+++ b/compat/w32pthreads.h
@@ -63,6 +63,9 @@ typedef CONDITION_VARIABLE pthread_cond_t;
 #define InitializeCriticalSection(x) InitializeCriticalSectionEx(x, 0, 0)
 #define WaitForSingleObject(a, b) WaitForSingleObjectEx(a, b, FALSE)
 
+#define PTHREAD_CANCEL_ENABLE 1
+#define PTHREAD_CANCEL_DISABLE 0
+
 static av_unused unsigned __stdcall attribute_align_arg 
win32thread_worker(void *arg)
 {
 pthread_t *h = (pthread_t*)arg;
@@ -180,4 +183,9 @@ static inline int pthread_cond_signal(pthread_cond_t *cond)
 return 0;
 }
 
+static inline int pthread_setcancelstate(int state, int *oldstate)
+{
+return 0;
+}
+
 #endif /* COMPAT_W32PTHREADS_H */
diff --git a/libavformat/udp.c b/libavformat/udp.c
index 23c3773c64..692ff07cec 100644
--- a/libavformat/udp.c
+++ b/libavformat/udp.c
@@ -61,7 +61,11 @@
 #define IPPROTO_UDPLITE  136
 #endif
 
-#if HAVE_PTHREAD_CANCEL
+#if HAVE_W32THREADS 
+#include "compat/w32pthreads.h"
+#undef HAVE_PTHREAD_CANCEL 
+#define HAVE_PTHREAD_CANCEL 1
+#elif HAVE_PTHREAD_CANCEL
 #include 
 #endif
 
-- 
2.20.1 (Apple Git-117)

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH] avformat/udp: support w32pthreads compat

2020-03-02 Thread phunkyfish
---
 compat/w32pthreads.h | 10 ++
 libavformat/udp.c|  8 +++-
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/compat/w32pthreads.h b/compat/w32pthreads.h
index 7df33b7da4..64cd40cda4 100644
--- a/compat/w32pthreads.h
+++ b/compat/w32pthreads.h
@@ -63,6 +63,11 @@ typedef CONDITION_VARIABLE pthread_cond_t;
 #define InitializeCriticalSection(x) InitializeCriticalSectionEx(x, 0, 0)
 #define WaitForSingleObject(a, b) WaitForSingleObjectEx(a, b, FALSE)
 
+#undef PTHREAD_CANCEL_ENABLE
+#undef PTHREAD_CANCEL_DISABLE
+#define PTHREAD_CANCEL_ENABLE 1
+#define PTHREAD_CANCEL_DISABLE 0
+
 static av_unused unsigned __stdcall attribute_align_arg 
win32thread_worker(void *arg)
 {
 pthread_t *h = (pthread_t*)arg;
@@ -180,4 +185,9 @@ static inline int pthread_cond_signal(pthread_cond_t *cond)
 return 0;
 }
 
+static inline int pthread_setcancelstate(int state, int *oldstate)
+{
+return 0;
+}
+
 #endif /* COMPAT_W32PTHREADS_H */
diff --git a/libavformat/udp.c b/libavformat/udp.c
index 23c3773c64..4f42b026cd 100644
--- a/libavformat/udp.c
+++ b/libavformat/udp.c
@@ -61,10 +61,16 @@
 #define IPPROTO_UDPLITE  136
 #endif
 
-#if HAVE_PTHREAD_CANCEL
+#if HAVE_PTHREAD_CANCEL && !defined(HAVE_W32THREADS)
 #include 
 #endif
 
+#if HAVE_W32THREADS 
+#include "compat/w32pthreads.h"
+#undef HAVE_PTHREAD_CANCEL 
+#define HAVE_PTHREAD_CANCEL 1
+#endif
+
 #ifndef IPV6_ADD_MEMBERSHIP
 #define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP
 #define IPV6_DROP_MEMBERSHIP IPV6_LEAVE_GROUP
-- 
2.20.1 (Apple Git-117)

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH] avformat/udp: support w32pthreads compat

2020-03-02 Thread phunkyfish
---
 compat/w32pthreads.h | 8 
 libavformat/udp.c| 8 +++-
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/compat/w32pthreads.h b/compat/w32pthreads.h
index 7df33b7da4..6405e72b64 100644
--- a/compat/w32pthreads.h
+++ b/compat/w32pthreads.h
@@ -63,6 +63,9 @@ typedef CONDITION_VARIABLE pthread_cond_t;
 #define InitializeCriticalSection(x) InitializeCriticalSectionEx(x, 0, 0)
 #define WaitForSingleObject(a, b) WaitForSingleObjectEx(a, b, FALSE)
 
+#define PTHREAD_CANCEL_ENABLE 1
+#define PTHREAD_CANCEL_DISABLE 0
+
 static av_unused unsigned __stdcall attribute_align_arg 
win32thread_worker(void *arg)
 {
 pthread_t *h = (pthread_t*)arg;
@@ -180,4 +183,9 @@ static inline int pthread_cond_signal(pthread_cond_t *cond)
 return 0;
 }
 
+static inline int pthread_setcancelstate(int state, int *oldstate)
+{
+return 0;
+}
+
 #endif /* COMPAT_W32PTHREADS_H */
diff --git a/libavformat/udp.c b/libavformat/udp.c
index 23c3773c64..4f42b026cd 100644
--- a/libavformat/udp.c
+++ b/libavformat/udp.c
@@ -61,10 +61,16 @@
 #define IPPROTO_UDPLITE  136
 #endif
 
-#if HAVE_PTHREAD_CANCEL
+#if HAVE_PTHREAD_CANCEL && !defined(HAVE_W32THREADS)
 #include 
 #endif
 
+#if HAVE_W32THREADS 
+#include "compat/w32pthreads.h"
+#undef HAVE_PTHREAD_CANCEL 
+#define HAVE_PTHREAD_CANCEL 1
+#endif
+
 #ifndef IPV6_ADD_MEMBERSHIP
 #define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP
 #define IPV6_DROP_MEMBERSHIP IPV6_LEAVE_GROUP
-- 
2.20.1 (Apple Git-117)

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [avfomat/rtp: source ips lost when specified as URL options] Patch for ffmpeg using rtp protocol where sources option is not retained

2020-02-12 Thread phunkyfish
---
 libavformat/rtsp.c | 26 --
 1 file changed, 24 insertions(+), 2 deletions(-)

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 859defa592..f922055134 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -2334,7 +2334,9 @@ static int sdp_read_header(AVFormatContext *s)
 RTSPStream *rtsp_st;
 int size, i, err;
 char *content;
+const char *p, *sp="", *sources="", *sp2, *sources2;
 char url[1024];
+char sources_buf[1024];
 
 if (!ff_network_init())
 return AVERROR(EIO);
@@ -2360,6 +2362,16 @@ static int sdp_read_header(AVFormatContext *s)
 av_freep(&content);
 if (err) goto fail;
 
+/* Search for sources= tag in original URL for rtp protocol only */
+if (strncmp(s->url, "rtp://", 6) == 0) {
+p = strchr(s->url, '?');
+if (p && av_find_info_tag(sources_buf, sizeof(sources_buf), "sources", 
p)) {
+/* av_log(s, AV_LOG_VERBOSE, "sdp_read_header found sources %s\n", 
sources_buf);  */
+sp = sources_buf;
+sources = "&sources=";
+}
+}
+
 /* open each RTP stream */
 for (i = 0; i < rt->nb_rtsp_streams; i++) {
 char namebuf[50];
@@ -2377,12 +2389,22 @@ static int sdp_read_header(AVFormatContext *s)
 av_dict_free(&opts);
 goto fail;
 }
+
+/* Prepare to add sources to the url to be opened.
+   Otherwise the join to the source specific muliticast will be 
missing */
+sources2 = sources;
+sp2 = sp;
+/* ignore sources from original URL, when sources are already set 
in rtsp_st */
+if (rtsp_st->nb_include_source_addrs > 0)
+sources2 = sp2 = "";
+
 ff_url_join(url, sizeof(url), "rtp", NULL,
 namebuf, rtsp_st->sdp_port,
-"?localport=%d&ttl=%d&connect=%d&write_to_source=%d",
+
"?localport=%d&ttl=%d&connect=%d&write_to_source=%d%s%s",
 rtsp_st->sdp_port, rtsp_st->sdp_ttl,
 rt->rtsp_flags & RTSP_FLAG_FILTER_SRC ? 1 : 0,
-rt->rtsp_flags & RTSP_FLAG_RTCP_TO_SOURCE ? 1 : 0);
+rt->rtsp_flags & RTSP_FLAG_RTCP_TO_SOURCE ? 1 : 0,
+sources2, sp2);
 
 append_source_addrs(url, sizeof(url), "sources",
 rtsp_st->nb_include_source_addrs,
-- 
2.20.1 (Apple Git-117)

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH v4] libavformat/rtsp: return error if rtsp_hd_out is null instead of crash

2019-09-19 Thread phunkyfish
---
 libavformat/rtsp.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index c153cac88b..859defa592 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -1318,6 +1318,9 @@ static int 
rtsp_send_cmd_with_content_async(AVFormatContext *s,
 char buf[4096], *out_buf;
 char base64buf[AV_BASE64_SIZE(sizeof(buf))];
 
+if (!rt->rtsp_hd_out)
+return ENOTCONN;
+
 /* Add in RTSP headers */
 out_buf = buf;
 rt->seq++;
-- 
2.20.1 (Apple Git-117)

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH v3] libavformat/rtsp: return error if rtsp_hd_out is null instead of crash

2019-09-18 Thread phunkyfish
---
 libavformat/rtsp.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index c153cac88b..5e8adfaf3c 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -1318,6 +1318,9 @@ static int 
rtsp_send_cmd_with_content_async(AVFormatContext *s,
 char buf[4096], *out_buf;
 char base64buf[AV_BASE64_SIZE(sizeof(buf))];
 
+if (rt && !rt->rtsp_hd_out)
+return ENOTCONN;
+
 /* Add in RTSP headers */
 out_buf = buf;
 rt->seq++;
-- 
2.20.1 (Apple Git-117)

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH v2] libavformat/rtsp: return error if rtsp_hd_out is null instead of crash

2019-09-17 Thread phunkyfish
---
 libavformat/rtsp.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index c153cac88b..3e8606dade 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -1318,6 +1318,9 @@ static int 
rtsp_send_cmd_with_content_async(AVFormatContext *s,
 char buf[4096], *out_buf;
 char base64buf[AV_BASE64_SIZE(sizeof(buf))];
 
+if (rt->rtsp_hd_out == NULL)
+return ENOTCONN;
+
 /* Add in RTSP headers */
 out_buf = buf;
 rt->seq++;
-- 
2.20.1 (Apple Git-117)

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH 1/1] libavformat/rtsp: return error if rtsp_hd_out is null instead of crash

2019-09-17 Thread phunkyfish
---
 libavformat/rtsp.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index c153cac88b..6de090b7ce 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -1315,6 +1315,8 @@ static int 
rtsp_send_cmd_with_content_async(AVFormatContext *s,
 int send_content_length)
 {
 RTSPState *rt = s->priv_data;
+if (rt->rtsp_hd_out == NULL)
+return ENOTCONN;
 char buf[4096], *out_buf;
 char base64buf[AV_BASE64_SIZE(sizeof(buf))];
 
-- 
2.20.1 (Apple Git-117)

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH 0/1] libavformat/rtsp: return error if rtsp_hd_out is null instead of crash

2019-09-17 Thread phunkyfish
There is an issue in kodi where this value can be null, a previous patch 
attempted to fix this in rtspdec but the more correct solution is to return an 
error in that case

phunkyfish (1):
  libavformat/rtsp: return error if rtsp_hd_out is null instead of crash

 libavformat/rtsp.c | 2 ++
 1 file changed, 2 insertions(+)

-- 
2.20.1 (Apple Git-117)

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".