<div dir="ltr">I am using av_read_frame to read from an incoming TCP audio stream, that was opened by avformat_open_input with ("tcp://<a href="http://127.0.0.1:62011?listen">127.0.0.1:62011?listen</a>") as the source file.<div><br></div><div>The server connects to this and sends the data, and av_read_frame returns frames of audio data that avcodec_decode_audio4 decodes for me.  All is fine.</div><div><br></div><div>Then the server stops sending for a bit, because it's asked to be paused, and then a short (or long) time later, it is asked to start again, but because the data is from a stream, not a file, the data is actually not a continuation of what came before, but essentially starts anew.  At this point av_read_frame stalls, and never returns a new frame, despite lots of data being pushed to it, and the ffmpeg libraries keeping the port open to receive the data.</div><div><br></div><div>So my question is a) can I force av_read_frame to return after a timeout, so that I can potentially handle a restart? or b) can av_read_frame be persuaded to restart itself if it can't synchronize to the incoming data?</div><div><br></div><div>Regards,</div><div>Simon</div></div>