On Thu, 24 Dec 2020, Nicolas George wrote:

+static int librist_read(URLContext *h, uint8_t *buf, int size)
+{
+    RISTContext *s = h->priv_data;
+    const struct rist_data_block *data_block;
+    int ret;
+

+    ret = rist_receiver_data_read(s->rist_ctx, &data_block, 5);

Already mentioned: the 5 millisecond timeout not acceptable. Set it to 0
in non-blocking mode and as large as possible in blocking mode.

Actually it should be POLLING_TIME as defined in libavformat/network.h for blocking mode if you want behaviour to be consistent with other protocols. The function cannot block indefinitely even in blocking mode to be able allow generic code in libavformat/avio.c:retry_transfer_wrapper to abort a blocking wait.

Other protocols are directly using poll/select to wait for data with POLLING_TIME timeout, but since librist does not provide a way to poll for data, this is the best we can do (and return EAGAIN even in blocking mode if the POLLING_TIME elapses, because retry_transfer_wrapper will retry in that case anyway)

Regards,
Marton
_______________________________________________
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