<div dir="ltr">Yes, you should use <b>interrupt_callback</b>:<div><a href="https://www.ffmpeg.org/doxygen/3.0/structAVFormatContext.html#a5b37acfe4024d92ee510064e80920b40">https://www.ffmpeg.org/doxygen/3.0/structAVFormatContext.html#a5b37acfe4024d92ee510064e80920b40</a><br></div><div><a href="https://www.ffmpeg.org/doxygen/3.0/structAVIOInterruptCB.html">https://www.ffmpeg.org/doxygen/3.0/structAVIOInterruptCB.html</a><br></div><div><br></div><div>This callback function is called repeatedly when there's a blocking operation like av_read_frame</div><div>Just return 1 if you want to abort any blocking operation</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Jul 31, 2016 at 1:25 PM, qw <span dir="ltr"><<a href="mailto:applemax82@163.com" target="_blank">applemax82@163.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><div>Hi,<br><br>I use avformat_open_input(), and avformat_find_stream_info() to open rtmp stream, and use av_read_frame() to read av packet. If there is no incoming rtmp stream, avformat_open_input() and  avformat_find_stream_info() will wait indefinitely. If incoming rtmp stream is terminated in the middle, av_read_frame() will wait indefinitely.<br><br>Is there some method for ffmpeg lib to effective handle this sort of indefinite waiting in case of network issue?<br><br>Thanks!<br><br>Regards<br><br>Andrew<br><br></div></div><br><br><span title="neteasefooter"><p> </p></span><br>______________________________<wbr>_________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org">Libav-user@ffmpeg.org</a><br>
<a href="http://ffmpeg.org/mailman/listinfo/libav-user" rel="noreferrer" target="_blank">http://ffmpeg.org/mailman/<wbr>listinfo/libav-user</a><br>
<br></blockquote></div><br></div>