[FFmpeg-devel] [PATCH] avformat/tls_schannel: forward AVIO_FLAG_NONBLOCK to tcp stream
Gyan Doshi
ffmpeg at gyani.pro
Wed Jun 19 07:38:00 EEST 2024
On 2024-06-18 11:53 pm, Timo Rothenpieler wrote:
> On 18.06.2024 18:56, Gyan Doshi wrote:
>> FWIW, I had to do the same for securetransport on a project a couple
>> of years back to get rtmps working. Worked fine, and did not get any
>> reports of ill-effects.
>
> You mean the FFmpeg implementation of rtmps?
> Cause if so, I think that only makes use of nonblocking mode for
> receiving, not sending.
> So it wouldn't run into this if it was wrong.
IIRC, the setup/handshake phase would never complete.
Adding this fixed it
--------
+ TLSShared *s = &c->tls_shared;
+ int set_flag_nonblock = 0;
+
+ if (h->flags & AVIO_FLAG_NONBLOCK && !(s->tcp->flags &
AVIO_FLAG_NONBLOCK)) {
+ s->tcp->flags |= AVIO_FLAG_NONBLOCK;
+ set_flag_nonblock = 1;
+ }
+
int read = ffurl_read(c->tls_shared.tcp, data, requested);
+
+ if (set_flag_nonblock)
+ s->tcp->flags &= ~AVIO_FLAG_NONBLOCK;
--------
Regards,
Gyan
More information about the ffmpeg-devel
mailing list