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

_______________________________________________
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".

Reply via email to