>From 6300547d7dc9af28fc95f111cf0e3e79c48d6bd8 Mon Sep 17 00:00:00 2001
From: Sven Dueking <sven.dueking@nablet.com>
Date: Tue, 20 Mar 2018 20:27:49 -0400
Subject: [PATCH] - rendezvous requires bind

Signed-off-by: Sven Dueking <sven.dueking@nablet.com>
---
 libavformat/opensrt.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/libavformat/opensrt.c b/libavformat/opensrt.c
index 380b043..e20a3a2 100644
--- a/libavformat/opensrt.c
+++ b/libavformat/opensrt.c
@@ -397,6 +397,15 @@ static int opensrt_setup(URLContext *h, const char *uri, int flags)
             goto fail1;
         fd = ret;
     } else {
+
+
+        if (s->mode == SRT_MODE_RENDEZVOUS) {
+
+            ret = srt_bind(fd, cur_ai->ai_addr, cur_ai->ai_addrlen);
+            if (ret)
+                goto fail1;
+        }
+
         if ((ret = opensrt_listen_connect(s->eid, fd, cur_ai->ai_addr, cur_ai->ai_addrlen,
                                      open_timeout / 1000, h, !!cur_ai->ai_next)) < 0) {

--
1.8.3.1
