<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 9 Nov 2021 at 15:43, Yurii Monakov <<a href="mailto:monakov.y@gmail.com">monakov.y@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>You can add "timeout" to the options dictionary (avformat_open_input).</div><div><br></div><div>AVDictionary* opt = 0;</div><div>av_dict_set_int(&opt, "timeout", 1000000);</div><div></div><div>avformat_open_input(..., &opt);</div><div><br></div><div>For TCP this will set open/receive timeout to 1 second.</div><div><br></div><div>Best Regards,</div><div>Yurii<br></div><div><br></div></div></blockquote><div>Thank you, i had stimeout set in the dictionary, and have now included timeout.  But it doesn't actually help:</div><div>if the connection is never started, then it aborts, but once started it doesn't timeout after the connection has been made even if no new data is being sent.</div><div><br></div><div>The real problem is that the server sends data, I receive it and decode it.  The server stops sending data but maintains the connection.  The server starts sending data again and the port is still open, but av_read_frame has blocked, so nothing is done with the data that is sent.  How can I stop av_read_frame from blocking?</div><div><br></div><div>Regards,</div><div>Simon </div></div></div>