[FFmpeg-cvslog] srt: Set srto_sender flag to sender srt socket

Sven Dueking git at videolan.org
Wed Feb 20 20:52:08 EET 2019


ffmpeg | branch: master | Sven Dueking <sven.dueking at nablet.com> | Thu Feb  7 09:38:16 2019 +0100| [90b15f60bf4919deaed66d868e18107eba371da7] | committer: Luca Barbato

srt: Set srto_sender flag to sender srt socket

SRT API Documentation:
This flag is superfluous if both parties are at least version 1.3.0
(this shall be enforced by setting this value to SRTO_MINVERSION if
you expect that it be true) and therefore support HSv5 handshake,
where the SRT extended handshake is done with the overall handshake
process.

This flag is however obligatory if at least one party may be using
SRT below version 1.3.0 and does not support HSv5.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=90b15f60bf4919deaed66d868e18107eba371da7
---

 libavformat/libsrt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/libsrt.c b/libavformat/libsrt.c
index f901bba875..dd91eb49f7 100644
--- a/libavformat/libsrt.c
+++ b/libavformat/libsrt.c
@@ -300,7 +300,8 @@ static int libsrt_set_options_pre(URLContext *h, int fd)
         (s->tlpktdrop >= 0 && libsrt_setsockopt(h, fd, SRTO_TLPKTDROP, "SRTO_TLPKDROP", &s->tlpktdrop, sizeof(s->tlpktdrop)) < 0) ||
         (s->nakreport >= 0 && libsrt_setsockopt(h, fd, SRTO_NAKREPORT, "SRTO_NAKREPORT", &s->nakreport, sizeof(s->nakreport)) < 0) ||
         (connect_timeout >= 0 && libsrt_setsockopt(h, fd, SRTO_CONNTIMEO, "SRTO_CONNTIMEO", &connect_timeout, sizeof(connect_timeout)) < 0) ||
-        (s->payload_size >= 0 && libsrt_setsockopt(h, fd, SRTO_PAYLOADSIZE, "SRTO_PAYLOADSIZE", &s->payload_size, sizeof(s->payload_size)) < 0)) {
+        (s->payload_size >= 0 && libsrt_setsockopt(h, fd, SRTO_PAYLOADSIZE, "SRTO_PAYLOADSIZE", &s->payload_size, sizeof(s->payload_size)) < 0) ||
+        ((h->flags & AVIO_FLAG_WRITE) && libsrt_setsockopt(h, fd, SRTO_SENDER, "SRTO_SENDER", &yes, sizeof(yes)) < 0)) {
         return AVERROR(EIO);
     }
     return 0;



More information about the ffmpeg-cvslog mailing list