summaryrefslogtreecommitdiff
path: root/libavformat/libsrt.c
diff options
context:
space:
mode:
authorSven Dueking <sven.dueking@nablet.com>2019-02-07 09:38:16 +0100
committerLuca Barbato <lu_zero@gentoo.org>2019-02-12 11:59:29 +0100
commit90b15f60bf4919deaed66d868e18107eba371da7 (patch)
tree585f319464c12993f2db548c96c01f5fdb922f02 /libavformat/libsrt.c
parent156ea66c91b1986a87916f187216978d686725f6 (diff)
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.
Diffstat (limited to 'libavformat/libsrt.c')
-rw-r--r--libavformat/libsrt.c3
1 files changed, 2 insertions, 1 deletions
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;